failed to install node-serialport on Raspberry Pi2
See original GitHub issueI 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:
- Created 8 years ago
- Comments:12 (5 by maintainers)
my config: gcc version 4.9.2 (Raspbian 4.9.2-10)
fixed my problem
@ericdai does it work if
is used rather than
Also, why is it necessary to use
sudo
?