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.

Error using npm install

See original GitHub issue

tried npm install cncjs -g today and got lots of errors relating to serialport.

node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.6/serialport-v4.0.6-node-v46-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.6 and node@4.5.0 (node-v46 ABI) (falling back to source compile with node-gyp) gyp WARN EACCES user “root” does not have permission to access the dev dir “/root/.node-gyp/4.5.0” gyp WARN EACCES attempting to reinstall using temporary dev dir “/usr/local/lib/node_modules/cncjs/node_modules/serialport/.node-gyp” make: Entering directory ‘/usr/local/lib/node_modules/cncjs/node_modules/serialport/build’ make: *** No rule to make target ‘…/.node-gyp/4.5.0/include/node/common.gypi’, needed by ‘Makefile’. Stop. make: Leaving directory ‘/usr/local/lib/node_modules/cncjs/node_modules/serialport/build’ gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) 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:200:12) gyp ERR! System Linux 4.4.30+ gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “build” “–fallback-to-build” “–module=/usr/local/lib/node_modules/cncjs/node_modules/ serialport/build/Release/serialport.node” “–module_name=serialport” “–module_path=/usr/local/lib/node_modules/cncjs/node_modules/serialport/build/Release” gyp ERR! cwd /usr/local/lib/node_modules/cncjs/node_modules/serialport gyp ERR! node -v v4.5.0 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_mod ules/cncjs/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/cncjs/node_modules/serialport/build/Release’ (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cncjs/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at emitTwo (events.js:87:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:829:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) node-pre-gyp ERR! System Linux 4.4.30+ node-pre-gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/cncjs/node_modules/serialport/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build” node-pre-gyp ERR! cwd /usr/local/lib/node_modules/cncjs/node_modules/serialport install: info lifecycle serialport@4.0.6~install: Failed to exec install script

node-pre-gyp ERR! node-pre-gyp -v v0.6.31 node-pre-gyp ERR! not ok

Seems to just time out on the next step…

Something wrong or something I am doing wrong?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
dru5412commented, Dec 5, 2016

Managed to resolve the issue, it was due to being root sudo when installing.

Installing as a user with sudo prefix seemed to resolve it…

Not sure if that was the main cause but fixed now, thanks for help.

Will close issue off.

0reactions
chetoncommented, Feb 19, 2017

May I know which gcc/g++ version you’re using in your raspberry pi? I saw some people encountered installation problems because they are using wheezy. gcc/g++ 4.8 or above is required for Node.js v4 or higher.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common errors | npm Docs
Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later. · This can be caused...
Read more >
npm install error from the terminal - Stack Overflow
Running just "npm install" will look for dependencies listed in your package.json. The error you're getting says that you don't have a ...
Read more >
NPM install error - Material Design for Bootstrap
Trying to install MDB pro 4.19.2 just downloaded and ran npm install but getting this error of sha512 not matching. Can someone tell...
Read more >
How to solve npm ERR! code 1 when running npm install
Fix npm error code 1 by updating your dependencies · Update one package version in package.json file · Then run npm install ·...
Read more >
Step by step solution for npm install error - M220JS - MongoDB
Delete the package-lock. · If you see a lot of warning & error messages related to npm-gyp, run npm rebuild & this should...
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