npm start error?
I’m using a RPi 0 wireless, I have followed this tutorial step by step: https://forum.magicmirror.builders/topic/2075/magicmirror-on-pi-zero-w/2. However, when I put in “npm start” I’m getting this message:
npm ERR! Linux 4.4.50+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm ERR! node v4.2.1 npm ERR! npm v2.14.7 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! email@example.com start: 'sh run-start.sh' npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the firstname.lastname@example.org start script 'sh run-start.sh'. npm ERR! 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! sh run-start.sh npm ERR! 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```
Here is the /home/pi/MagicMirror/npm-debug.log:
0 info it worked if it ends with ok 1 verbose cli ['/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using email@example.com 3 info using firstname.lastname@example.org 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info prestart email@example.com 6 info start firstname.lastname@example.org 7 verbose unsafe-perm in lifecycle true 8 info email@example.com Failed to exec start script 9 verbose stack Error: firstname.lastname@example.org start: 'sh run-start.sh' 9 verbose stack spawn ENOENT 9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:17:16) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at ChildProcess.emit (events.js:172:7) 9 verbose stack at maybeClose (internal/child_process.js:818:16) 9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 10 verbose pkgid email@example.com 11 verbose cwd /home/pi/MagicMirror 12 error Linux 4.4.50+ 16 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 14 error node v4.2.1 15 error npm v2.14.7 16 error file sh 17 error code ELIFECYCLE 18 error errno ENOENT 19 error syscall spawn 20 error firstname.lastname@example.org start: 'sh run-start.sh' 20 error spawn ENOENT 21 error Failed at the email@example.com start script 'sh run-start.sh'. 21 error This is most likely a problem with the magicmirror package, 21 error not with npm itself. 21 error Tell the author that this fails on your system: 21 error sh run-start.sh 21 error You can get their info via: 21 error npm owner ls magicmirror 21 error There is likely additional logging output above. 22 verbose exit [ 1, true ]
Any help on how to solve this issue would be greatly appreciated! Thanks in advanced!
@longod I don’t own a pi zero but I have few question.
- Were you on the MagicMirror folder when you did the npm start ?
- Were you directly on the pi using a usb keyboard (or equivalent) or were you on ssh ?
If you were on the MagicMirror folder and you were directly on the pi I don’t know what the issue could be.
If you wasn’t on the MagicMirror folder npm start won’t work.
If you accessed your pi by ssh you need to use
DISPLAY=:0 npm startcommand instead of npm start because graphical application need to know where they should be open. DISPLAY:0 mean the host machine (your pi)
Try updating your versions of node and npm as well
- Yea I was on the MagicMirror folder when I used npm start
- I’ve tried npm start on the pi using a keyboard, and I’ve tried through SSH. Got the same error message
npm installand it gave out:
npm WARN cannot run in wd @magicmirror2.1.1 cd vendor && npm install (wd=/home/pi/MagicMirror) npm WARN cannot run in wd @magicmirror2.1.1 sh installers/postinstall/postinstall.sh (wd=/home/pi/MagicMirror)
I then did
npm updateand that gave out:
/ > firstname.lastname@example.org postinstall /home/pi/MagicMirror/node_modules/electron > node install.js email@example.com node _modules/electron >firstname.lastname@example.org (email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org) >email@example.com (firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org)
afterwards I ran npm start on the pi, and DISPLAY=0: npm start on SHH, and got the same original error messages.
@longod what is your version of node ?
@longod I’m using the v7.9.0 . try to install an higher version of node
npm install --unsafe-perm
@romain Okay I’ve updated to v7.7.1. I then tried
DISPLAY=0: npm startand I got a similar message as before, however there is no longer a
ERR! node v4.2.1message, it skips over that part. Some progress!
@strawberry-3.141 I gave that a go and checked
npm -v, now its at 4.5.0 and is in the same boat as the node message that I was getting when I try to do
DISPLAY=0: npm start. There still is the rest of the
npm ERR!messages, just not the
npm ERR! node v4.2.1and
npm ERR! npm v2.14.7