maddox / dasher

🔘 A simple way to bridge your Amazon Dash buttons to HTTP services
MIT License
709 stars 93 forks source link

problem with npm install #48

Open mgobill opened 7 years ago

mgobill commented 7 years ago

I seem to be running into a problem when with setting this up on a raspberry pi 2 with wheezy. Following the readmi, after $ sudo apt-get install libpcap-dev and $ sudo apt-get install npm, I attempt $ npm install but get errors. Any help is appreciated. Thanks!

pi@raspberrypi ~/projects/dasher $ npm install npm http GET https://registry.npmjs.org/node-dash-button npm http GET https://registry.npmjs.org/request

npm ERR! Error: failed to fetch from registry: request npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9) npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18) npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22) npm ERR! at Request. (/usr/lib/nodejs/request/main.js:212:58) npm ERR! at Request.emit (events.js:88:20) npm ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:412:12) npm ERR! at ClientRequest.g (events.js:156:14) npm ERR! at ClientRequest.emit (events.js:67:17) npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7) npm ERR! You may report this log at: npm ERR! http://bugs.debian.org/npm npm ERR! or use npm ERR! reportbug --attach /home/pi/projects/dasher/npm-debug.log npm npm ERR! npm ERR! System Linux 4.4.16-v7+ npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! cwd /home/pi/projects/dasher npm ERR! node -v v0.6.19 npm ERR! npm -v 1.1.4 npm ERR! message failed to fetch from registry: request npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pi/projects/dasher/npm-debug.log npm not ok

legotheboss commented 7 years ago

@mgobill Your node and npm are extremely old, try updating them.

Here's how you can update npm

sudo npm install -g npm

tacofart commented 7 years ago

I got the same error. i did the update and now when I try to do npm isntall within dasher I get: pi@raspberrypi:~/dasher $ npm install /usr/bin/env: node: No such file or directory

How do I fix this?

mgobill commented 7 years ago

thanks for the replies! i think @legotheboss was right. i tried to update npm, ended up reinstalling it.

now when i run npm install it seems to work. afterwards though, when i run sudo npm run start i get `> dasher@1.1.1 start /home/pi/projects/dasher

node app.js

module.js:340 throw err; ^ Error: Cannot find module './build/Release/pcap_binding' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/pi/projects/dasher/node_modules/node-dash-button/node_modules/pcap/pcap.js:3:21) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

npm ERR! Linux 4.4.16-v7+ npm ERR! argv "node" "/usr/bin/npm" "run" "start" npm ERR! node v0.10.41 npm ERR! npm v2.15.11 npm ERR! code ELIFECYCLE npm ERR! dasher@1.1.1 start: node app.js npm ERR! Exit status 8 npm ERR! npm ERR! Failed at the dasher@1.1.1 start script 'node app.js'. npm ERR! This is most likely a problem with the dasher package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node app.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs dasher npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls dasher npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/projects/dasher/npm-debug.log`

legotheboss commented 7 years ago

@tacofart

Run these commands:

sudo npm install -g n
sudo n 4.4.4

@mgobill

Go to the dasher directory, cd /home/pi/projects/dasher Run the same commands as above, but then run sudo npm install

mgobill commented 7 years ago

weird, same thing happens. i will try the same thing on raspbian jessie and let you know how it goes. thanks for all the help!

dasher@1.1.1 start /home/pi/projects/dasher node app.js

module.js:327 throw err; ^

Error: Cannot find module './build/Release/pcap_binding' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/home/pi/projects/dasher/node_modules/node-dash-button/node_modules/pcap/pcap.js:3:21) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17)

npm ERR! Linux 4.4.16-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start" npm ERR! node v4.4.4 npm ERR! npm v2.15.1 npm ERR! code ELIFECYCLE npm ERR! dasher@1.1.1 start: node app.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dasher@1.1.1 start script 'node app.js'. npm ERR! This is most likely a problem with the dasher package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node app.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs dasher npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls dasher npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/projects/dasher/npm-debug.log

tacofart commented 7 years ago

@legotheboss

Ran the first command and getting this:

pi@raspberrypi:~ $ sudo npm install -g n /usr/bin/env: node: No such file or directory pi@raspberrypi:~ $

icojones commented 6 years ago

@tacofart

same error message...did you resolve it?