moritzmhmk / homebridge-camera-rpi

raspberry pi camera plugin for homebridge
MIT License
159 stars 29 forks source link

"npm install" error #39

Closed fanlessfan closed 5 years ago

fanlessfan commented 6 years ago

I use raspberry pi 0 w with stretch lite and encounter error below

pi@rPi08:/opt/homebridge-camera-rpi $ npm install

curve25519-n@1.4.0 install /opt/homebridge-camera-rpi/node_modules/hap-nodejs/node_modules/curve25519-n node-gyp rebuild

/bin/sh: 1: node: not found gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:304:16) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12) gyp ERR! System Linux 4.14.50+ gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /opt/homebridge-camera-rpi/node_modules/hap-nodejs/node_modules/curve25519-n gyp ERR! node -v v4.8.2 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

ed25519-hap@0.0.5 install /opt/homebridge-camera-rpi/node_modules/hap-nodejs/node_modules/ed25519-hap node-gyp rebuild

Traceback (most recent call last): File "/usr/share/node-gyp/gyp/gyp_main.py", line 9, in load_entry_point('gyp==0.1', 'console_scripts', 'gyp')() File "/usr/lib/python2.7/dist-packages/gyp/init.py", line 545, in script_main return main(sys.argv[1:]) File "/usr/lib/python2.7/dist-packages/gyp/init.py", line 538, in main return gyp_main(args) File "/usr/lib/python2.7/dist-packages/gyp/init.py", line 502, in gyp_main 'cwd': os.getcwd(), OSError: [Errno 2] No such file or directory gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:304:16) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12) gyp ERR! System Linux 4.14.50+ gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /opt/homebridge-camera-rpi/node_modules/hap-nodejs/node_modules/ed25519-hap gyp ERR! node -v v4.8.2 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm ERR! curve25519-n@1.4.0 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the curve25519-n@1.4.0 install script. npm ERR! This is most likely a problem with the curve25519-n package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls curve25519-n npm ERR! There is likely additional logging output above. npm ERR! System Linux 4.14.50+ npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! cwd /opt/homebridge-camera-rpi npm ERR! node -v v4.8.2 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /opt/homebridge-camera-rpi/npm-debug.log npm ERR! not ok code 0

fanlessfan commented 6 years ago

I followed the same process on my RPi3 and it works perfect. Is this support rPi 0 W?

moritzmhmk commented 6 years ago

does the command node work? And if not does nodejs work? If so follow instructions here.

Alternatively use the buildroot image available here.