10 Replies Latest reply on Dec 16, 2015 11:53 PM by DaveFer

    "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo

    VincentR

      Hi there,

       

      I have been struggling in the past few days trying to get the XDK IoT to work with my Galileo board. I have flashed the SD card with the latest XDK IoT image and I get serial and Ethernet working on the board but I cannot get the code to load. I systematically get the following error when I click 'run' after having clicked 'Upload' for the Blink example :

       

      UPLOADING: Uploading project bundle to IoT device.                                                                                                                                                                                                                  

                                                                                                                                                                                                                                                                          

      Intel XDK - Message Received: run                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                          

      ERROR: module.js:340                                                                                                                                                                                                                                                

      ERROR:     throw err;                                                                                                                                                                                                                                               

      ERROR:           ^                                                                                                                                                                                                                                                  

      ERROR: Error: Cannot find module '/node_app_slot'                                                                                                                                                                                                                   

          at Function.Module._resolveFilename (module.js:338:15)                                                                                                                                                                                                          

          at Function.Module._load (module.js:280:25)                                                                                                                                                                                                                     

          at Function.Module.runMain (module.js:497:10)                                                                                                                                                                                                                   

          at startup (node.js:119:16)                                                                                                                                                                                                                                     

          at node.js:929:3

       

      Does that ring a bell to anyone? This is very frustrating and I cannot find any information as to where the code is supposed to end up on the board (so that I can at least try to run it manually via node). The related threads mention /sketch but I don't get anything here (this is for Arduino sketches I think).

       

      I think the code ends up under /root/.node_app_slot which is empty for me :

      root@galileo:~# ls -al .node_app_slot/                                                                                                                                                                                                                              

      total 8                                                                                                                                                                                                                                                             

      drwxr-xr-x 2 root root 4096 Feb 26 01:05 .                                                                                                                                                                                                                          

      drwxr-xr-x 4 root root 4096 Feb 26 01:05 ..

       

      Could you help me out here?

       

      Many thanks for your assistance!

       

      Vincent

       

      PS: version info

      XDK: 1912

      Galileo image: 201502260041 (the IOT agent has been updated to the latest version via the UI).

      OS: Windows 7

        • 1. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
          Intel_Peter

          Hello VincentR,

           

          I was just able to replicate your issue on my Edison. The issue is that you don't have the MRAA library installed. No worries; just run the command opkg update and then opkg install libmraa0. After this you should be able to run your script. At least that solved the issue for me.

           

          Peter.

          • 2. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
            VincentR

            Hi Peter,

             

            Thanks for the suggestion. I installted libmraa0 successfully but this did not change anything :

            root@galileo:~# opkg list-installed | grep libmraa                                                                                                                                                                                                               

            libmraa0 - 0.6.2

             

            I have found there is indeed a /node_app_slot which is symlinked to /root/.node_app_slot and it is empty.

             

            I still get my error after the libmraa install :

            Intel XDK - Message Received: stop                                                                                                                                                                                                                                  

                                                                                                                                                                                                                                                                                

            Intel XDK - Message Received: run                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                

            ERROR: module.js:340                                                                                                                                                                                                                                                

            ERROR:     throw err;                                                                                                                                                                                                                                               

            ERROR:           ^                                                                                                                                                                                                                                                  

            ERROR: Error: Cannot find module '/node_app_slot'                                                                                                                                                                                                                   

                at Function.Module._resolveFilename (module.js:338:15)                                                                                                                                                                                                          

                at Function.Module._load (module.js:280:25)                                                                                                                                                                                                                     

                at Function.Module.runMain (module.js:497:10)                                                                                                                                                                                                                   

                at startup (node.js:119:16)                                                                                                                                                                                                                                     

                at node.js:929:3

             

            This is becoming frustrating. Is there a place I can look so that I can get error/status messages or a special switch to turn debug on on the target or the XDK? I think the download might be failing but there is no place I can look for errors ...

            • 3. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
              Intel_Peter

              That's weird… Can you show me the output of ls -la /node_app_slot. By looking at my Galileo I don't see any symbolic link on that folder.

               

              Peter.

              • 4. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
                VincentR

                Hi Peter,

                 

                Here it is (I realize I should have said /home/root instead of /root):

                root@galileo:~# ls -la /node_app_slot                                                                                                                                                                                                                              

                lrwxrwxrwx 1 root root 25 Feb 26 01:05 /node_app_slot -> /home/root/.node_app_slot

                • 5. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
                  VincentR

                  Hi,

                   

                  I got contacted by a member of the IoT XDK team and he said the XDK daemon operating mode (how it transfers files and where) is going to be documented in the next IoT XDK version, normally coming in August.While this does not fix my issue, I will reevaluate when the new version comes out and see if the problem occurs again.

                  1 of 1 people found this helpful
                  • 6. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
                    enginec

                    Hi VincentR,

                     

                    I met same problem like you. My solution is adding following line in package.json.

                     

                    "main": "xxxxx"

                     

                    where "xxxxx" is the start point of your node project, something like "app.js".  You will start your project with command  "node xxxxx"

                     

                    Hope this help you : )

                    • 7. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
                      ediyun

                      Hi enginec

                       

                      I have same problem like VincentR .

                       

                      and I installed mraa library too.

                       

                      you said its solution is adding following line in package.json.

                       

                      but I don't understand yours.

                       

                      can you tell me more detail?

                      • 9. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
                        enginec

                        Hi ediyun, glad you solve problem by yourself.

                        By the way, I think I need to clarify my solution.

                        this is the snapshop of my package.json file, where "main" is the start path of your node project.

                        Selection_047.png

                        • 10. Re: "Cannot find module '/node_app_slot'" error when running app in XDK IoT on Galileo
                          DaveFer

                          I was unable to use Ediyun's suggestion to fix this problem since my XDK project in question was a no-build solution (a node.js web server).

                           

                          I DID however use something similar to Enginec's solution. I simply changed the description in my package.json file. (The value for "main:" was already there and correct, so I merely changed the value of the "name" parameter in the same file.)


                          This tiny change must have triggered something which fixed the problem.

                           

                          Wish I could provide more insight. But I'm glad to have this fixed ... going to sleep.

                           

                              - Dave F.