question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors During 'npm install' in Two Environments

See original GitHub issue

Hey - Thanks for the script. Trying to use, but cannot get working. Have tried setting up in two separate linux environments with same issue. Below is environment, procedure i followed, and results. Any suggestions? Thanks

Environment

  • Raspberry Pi 3 /w Raspbian Installed
  • Connected via ethernet to LAN

I also tried Ubuntu 15.10 inside VM Workstation /w bridged NIC and got similar results

Procedure

  1. Obtained MAC of Dash from router
  2. Ran ‘apt-get update’ to update source
  3. Installed git, npm, & libpcap-dev without issue
  4. Created SSH key and added to my git account
  5. Ran ‘git clone git@github.com:maddox/dasher.git’ to clone repo successfully
  6. Ran ‘npm install’. Got following echo…
pi@KNCar:~ $ npm install
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open '/home/pi/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! System Linux 4.1.19-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/npm-debug.log
npm ERR! not ok code 0

  1. Since it couldn’t find package.json, I changed directory to the dasher root (~/dasher) and ran ‘npm install’ again to get this echo:
pi@KNCar:~/dasher $ npm install
npm WARN engine socketwatcher@0.3.0: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})

> socketwatcher@0.3.0 install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
> node-gyp rebuild

make: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
  CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
In file included from ../socket_watcher.hpp:8:0,
                 from ../socket_watcher.cpp:5:
../../nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
   static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
                                               ^
socketwatcher.target.mk:82: recipe for target 'Release/obj.target/socketwatcher/socket_watcher.o' failed
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.1.19-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
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

npm ERR! socketwatcher@0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the socketwatcher@0.3.0 install script.
npm ERR! This is most likely a problem with the socketwatcher 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 socketwatcher
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.1.19-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/dasher
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN engine hawk@3.1.3: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/dasher/npm-debug.log
npm ERR! not ok code 0
  1. Finally, I decided to try to launch it anyways to see what happened so from the root of ~/dasher ran ‘sudo npm run start’ and got the below:
pi@KNCar:~/dasher $ sudo npm run start

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


module.js:340
    throw err;
          ^
Error: Cannot find module 'node-dash-button'
    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.<anonymous> (/home/pi/dasher/lib/dasher.js:2:18)
    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! 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.
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 their info via:
npm ERR!     npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.1.19-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/pi/dasher
npm ERR! node -v v0.10.29
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!     /home/pi/dasher/npm-debug.log
npm ERR! not ok code 0

Any suggestions? Am I leaving out a big step? Thanks!

UPDATE After posting, I went back to the Ubunutu 15 VM. I installed nodejs-legacy then tried again and this time ‘npm install’ again and this time it completed without errors. I had tried installing it in Raspbian on my RP, but it was already installed and up to date so doesn’t help there. Would still much prefer to run on RP so the above post is still valid as all notes come from its installation. Thanks!

UPDATE #2 OK, ok, I spoke too soon… ‘npm install’ seemed to be successful as I didn’t see any error messages. I edited the example config file (below) and then saved it in the same path as config.json. While still in the ‘dasher’ root, I then ran ‘sudo npm run start’ - it started! I clicked my dash button and after a few seconds, the terminal flooded with about 20 mesage about EthernetFrame. The trigger from IFTTT never went so I clicked the button again. Almost instantly, I got the echo “undefined press” followed by many lines of echo in the terminal. I quit npm, then tried launching it again but got errors. All of the events described are below followed by my config file…

ben@ubuntu:~/dasher$ sudo npm run start

> dasher@1.1.1 start /home/ben/dasher
> node app.js

undefined added.
undefined added.
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
undefined pressed.
there was an error
[Error: SELF_SIGNED_CERT_IN_CHAIN]

/home/ben/dasher/lib/dasher.js:38
    if (response.statusCode === 401) {
                ^
TypeError: Cannot read property 'statusCode' of undefined
    at Request.onResponse [as _callback] (/home/ben/dasher/lib/dasher.js:38:17)
    at self.callback (/home/ben/dasher/node_modules/request/request.js:200:22)
    at Request.EventEmitter.emit (events.js:95:17)
    at Request.onRequestError (/home/ben/dasher/node_modules/request/request.js:831:8)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1547:9)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at SecurePair.<anonymous> (tls.js:1389:19)
    at SecurePair.EventEmitter.emit (events.js:92:17)
    at SecurePair.maybeInitFinished (tls.js:982:10)

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.
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 their info via:
npm ERR!     npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.2.0-16-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/ben/dasher
npm ERR! node -v v0.10.25
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!     /home/ben/dasher/npm-debug.log
npm ERR! not ok code 0
ben@ubuntu:~/dasher$ sudo npm run start

> dasher@1.1.1 start /home/ben/dasher
> node app.js


module.js:485
    throw err;
          ^
SyntaxError: /home/ben/dasher/config/config.json: Unexpected token ]
    at Object.parse (native)
    at Object.Module._extensions..json (module.js:482:27)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/ben/dasher/app.js:2:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

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.
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 their info via:
npm ERR!     npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.2.0-16-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/ben/dasher
npm ERR! node -v v0.10.25
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!     /home/ben/dasher/npm-debug.log
npm ERR! not ok code 0

My (Edited) config.json file

{"buttons":[
  {
    "address": "mymacaddress",
    "url": "https://maker.ifttt.com/trigger/Notify/with/key/mykey",
    "method": "POST"
  },
]}

Thoughts? Thanks!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
legothebosscommented, Jul 21, 2016

@jettw @ez2remember @BzowK try installing the latest version of Node… For Raspberry Pi, use these commands:

wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
sudo dpkg -i node_latest_armhf.deb
3reactions
webdigicommented, Nov 24, 2016

Had the same issue and nothing would work. Finally had to go to node 0.10.26 on the pi.

Used NVM instead of direct node install. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash nvm install 0.10.26

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common errors | npm Docs
You are trying to install on a drive that either has no space, or has no permission to write. Free some disk space...
Read more >
How to solve the errors with NPM Install? - Stack Overflow
1 Answer 1 · Try to remove the package-lock file & your node_modules folder · and re-run the command npm install --legacy-peer-deps.
Read more >
Missing dependencies after running `npm install` a second time
I'm opening this issue because: npm is crashing. npm is producing an incorrect install. npm is doing something I don't understand.
Read more >
NodeJS - npm install errors on Windows - YouTube
NOTE: If you are using Windows 10, you will want to open an Administrator PowerShell (right-click and choose "Run as administrator").
Read more >
Reproducible Node Builds With npm ci - Semaphore
Two Sources of Truth ... The npm install algorithm first checks if package.json and package-lock.json match. If they do, npm follows the lockfile ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found