npm start dev


  • Module Developer

    Hi there

    I try to start my mirror whit npm start dev to do some debugging but there are always a lot of errors. What’s wrong here?

    pi@raspberrypi:~/MagicMirror $ npm start dev
    
    > magicmirror@2.0.0 start /home/pi/MagicMirror
    > electron js/electron.js "dev"
    
    
    npm ERR! Linux 4.4.13-v7+
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "dev"
    npm ERR! node v6.4.0
    npm ERR! npm  v3.10.3
    npm ERR! code ELIFECYCLE
    npm ERR! magicmirror@2.0.0 start: `electron js/electron.js "dev"`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the magicmirror@2.0.0 start script 'electron js/electron.js "dev"'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the magicmirror package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     electron js/electron.js "dev"
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs magicmirror
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls magicmirror
    npm ERR! There is likely additional logging output above.
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     /home/pi/MagicMirror/npm-debug.log
    


  • Hi Bangee

    I’ve had exactly the same problem. I’ve tried it on a rasp 2, a rasp 3 and still the same result. Tried reinstalling node.js, reinstalling npm. I’m beginning to think there’s something up with Mich;s installation script but I cant find any clues in the output. Apparently it’s known that sometimes electron will fail on some rasp 2’s- so i went ou t and bought a rasp 3. I’m currently trying it again on a new card - if it doesn’t work this time i’ll try the manual install method. No luck yet.

    pi@magicpi:~ $ cd MagicMirror/config
    pi@magicpi:~/MagicMirror/config $ cp config.js.sample config.js
    pi@magicpi:~/MagicMirror/config $ cd $HOME/MagicMirror
    pi@magicpi:~/MagicMirror $ npm start
    
    > magicmirror@2.0.0 start /home/pi/MagicMirror
    > electron js/electron.js
    
    
    npm ERR! Linux 4.4.11-v7+
    npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
    npm ERR! node v6.6.0
    npm ERR! npm  v3.10.3
    npm ERR! code ELIFECYCLE
    npm ERR! magicmirror@2.0.0 start: `electron js/electron.js`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the magicmirror@2.0.0 start script 'electron js/electron.js'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the magicmirror package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     electron js/electron.js
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs magicmirror
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls magicmirror
    npm ERR! There is likely additional logging output above.
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     /home/pi/MagicMirror/npm-debug.log
    

    Note from admin: Please use Markdown on code snippets for easier reading!



  • Hey!

    in the readme i found this:

    Important: npm start does not work via SSH, use DISPLAY=:0 nohup npm start & instead. This starts the mirror on the remote display.



  • Thanks ost - but I have tried it both from direct physical keyboard and SSH using this command. I’ve been reading a few other problems related to this issue but all seems to come down to “not installing as root user”. Which i’m not - I’m installing as pi. So still scratching my head here.



  • do you have create an mm.sh and starts this with pm2?



  • @ostfilinchen I was just using the standard install script that comes on the tutorial.

    curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh | bash




  • Module Developer

    hey there
    @ostfilinchen that’s it. to start npm from my shell it need to use this command:
    DISPLAY=:0 npm start dev

    But with this I can not debug my script. Electron crashes alwasy on startup when I’ve activated my new module using const sensorLib = require('node-dht-sensor') in my node_helper.js

    How can I debug this error?



  • OK i think i’ve solved it. magic mirror HAS to be started (npm start) from a terminal window in the x-window server. you cannot start it over ssh.



  • @shavesophere Thank you. This at least got me to the point where I can show the display on a monitor. Now I just have to walk to the other room to see my changes. :/


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.