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.

failed to install node-serialport on Raspberry Pi2

See original GitHub issue

I follow the document to install serialport module on Raspberry Pi2 ,but failed. pi@raspberrypi:~ $ sudo npm install serialport /

serialport@2.0.5 install /home/pi/node_modules/serialport node-pre-gyp install --fallback-to-build

gyp WARN EACCES user “root” does not have permission to access the dev dir “/roo t/.node-gyp/0.12.6” gyp WARN EACCES attempting to reinstall using temporary dev dir “/home/pi/node_m odules/serialport/.node-gyp” gyp WARN install got an error, rolling back install gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: read ECONNRESET gyp ERR! stack at exports._errnoException (util.js:746:11) gyp ERR! stack at TCP.onread (net.js:559:26) gyp ERR! System Linux 4.1.13-v7+ gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_mod ules/node-gyp/bin/node-gyp.js” “configure” “–fallback-to-build” “–module=/home /pi/node_modules/serialport/build/Release/node-v14-linux-arm/serialport.node” “- -module_name=serialport” “–module_path=/home/pi/node_modules/serialport/build/R elease/node-v14-linux-arm” gyp ERR! cwd /home/pi/node_modules/serialport gyp ERR! node -v v0.12.6 gyp ERR! node-gyp -v v2.0.1 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 configure --fallback -to-build --module=/home/pi/node_modules/serialport/build/Release/node-v14-linux -arm/serialport.node --module_name=serialport --module_path=/home/pi/node_module s/serialport/build/Release/node-v14-linux-arm’ (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/pi/node_modules/s erialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:110:17) node-pre-gyp ERR! stack at maybeClose (child_process.js:1015:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_proces s.js:1087:5) node-pre-gyp ERR! System Linux 4.1.13-v7+ node-pre-gyp ERR! command “node” “/home/pi/node_modules/serialport/node_modules/ .bin/node-pre-gyp” “install” “–fallback-to-build” node-pre-gyp ERR! cwd /home/pi/node_modules/serialport node-pre-gyp ERR! node -v v0.12.6 node-pre-gyp ERR! node-pre-gyp -v v0.6.13 node-pre-gyp ERR! not ok Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modu les/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/nod e_modules/serialport/build/Release/node-v14-linux-arm/serialport.node --module_n ame=serialport --module_path=/home/pi/node_modules/serialport/build/Release/node -v14-linux-arm’ (1) npm ERR! Linux 4.1.13-v7+ npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “serialport” npm ERR! node v0.12.6 npm ERR! npm v2.11.2 npm ERR! code ELIFECYCLE

npm ERR! serialport@2.0.5 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the serialport@2.0.5 install script ‘node-pre-gyp install --f allback-to-build’. npm ERR! This is most likely a problem with the serialport package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-pre-gyp install --fallback-to-build npm ERR! You can get their info via: npm ERR! npm owner ls serialport npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log pi@raspberrypi:~ $

how to process it ?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
devrobot01commented, May 31, 2016

my config: gcc version 4.9.2 (Raspbian 4.9.2-10)

wget http://node-arm.herokuapp.com/node_latest_armhf.deb
dpkg -i node_latest_armhf.deb
npm install -g node-gyp
sudo npm install --unsafe-perm serialport

fixed my problem

5reactions
fivdicommented, Dec 27, 2015

@ericdai does it work if

sudo npm install --unsafe-perm serialport

is used rather than

sudo npm install serialport

Also, why is it necessary to use sudo?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cant install on raspberry pi #2255 - serialport/node ... - GitHub
I was trying to install serial, but it keeps giving this output: root@DietPi:~# sudo npm install serialport --unsafe-perm --build-from-sourc ...
Read more >
ERROR! Installing node serialPort On raspberry Pi 3 model b
First Step - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs sudo apt-get install -y build- ...
Read more >
node.js problem with serialport ? - Raspberry Pi Forums
The error occurred because serialport was installed using Node.js v11.x but at runtime Node.js v10.x was used.
Read more >
Installing SerialPort
These projects use Node Serialport under the hood. To enable the serial port on Raspbian, you launch raspi-config , then select Interfacing ...
Read more >
node-red-node-serialport (node) - Node-RED Library
During install there may be multiple messages about optional compilation. These may look like failures... as they report as failure to compile errors...
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