serialport / node-serialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
https://serialport.io
MIT License
5.79k stars 1.01k forks source link

Impossible to install the latest version on Raspberry Pi #368

Closed marcoschwartz closed 9 years ago

marcoschwartz commented 10 years ago

Hello, I just re installed everything on my Raspberry Pi and I can't install node-serialport anymore. I am running the latest version of Debian Wheezy, node & npm (installed by following your instructions). This is what I got after doing a npm install serialport:

serialport@1.4.5 install /home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport node-pre-gyp install --fallback-to-build

EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.29" gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/.node-gyp" WARN install got an error, rolling back install install got an error, rolling back install ERR! configure error- stack Error: unexpected eof gyp ERR! stack at decorate (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/abstract.js:67:36) gyp ERR! stack at Extract.Abstract.error (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/abstract.js:61:12) gyp ERR! stack at Extract._streamEnd (/usr/local/lib/node_modules/npm/node_modules/tar/lib/extract.js:75:22) stack at BlockStream. (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:50:8) gyp ERR! stack at BlockStream.emit (events.js:92:17) ERR! stack at BlockStream._emitChunk (/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:203:10) stack at BlockStream.resume (/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:58:15) gyp ERR! stack at Extract.Reader.resume (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/reader.js:253:34) stack at Entry. (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:256:8) gyp ERR! stack at Entry.emit (events.js:92:17) gyp ERR! System Linux 3.12.22+ "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.5" "--major=1" "--minor=4" "--patch=5" "--runtime=node" "--node_abi=node-v11" "--platform=linux" "--target_platform=linux" "--arch=arm" "--target_arch=arm" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-linux-arm" "--remote_path=./serialport/v1.4.5/Release/" "--package_name=node-v11-linux-arm.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz" gyp ERR! cwd /home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport v0.10.29e -v| ERR! node-gyp -v v0.13.1 gyp ERR! not ok ERR! build error ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=linux --target_platform=linux --arch=arm --target_arch=arm --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-linux-arm --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-linux-arm.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz' (1) at ChildProcess. (/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17) ERR! stack at maybeClose (child_process.js:755:16) at Process.ChildProcess._handle.onexit (child_process.js:822:5) node-pre-gyp ERR! System Linux 3.12.22+ "node" "/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" cwd /home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport node-pre-gyp ERR! node -v v0.10.29 ERR! node-pre-gyp -v v0.5.19 ode-pre-gyp ERR! not ok| Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=linux --target_platform=linux --arch=arm --target_arch=arm --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-linux-arm --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-linux-arm.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz' (1) npm ERR! serialport@1.4.5 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the serialport@1.4.5 install script. 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! System Linux 3.12.22+ npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "arest" npm ERR! cwd /home/pi/work/home-automation-arduino/chapter4/interface npm ERR! node -v v0.10.29 npm ERR! npm -v 1.4.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pi/work/home-automation-arduino/chapter4/interface/npm-debug.log npm ERR! not ok code 0

What can I do ?

voodootikigod commented 10 years ago

It appears you have a permissions error, have you tried sudo npm install node-serialport?

Chris Williams

@voodootikigod http://twitter.com/voodootikigod | GitHub http://github.com/voodootikigod

The things I make that you should check out: SaferAging http://www.saferaging.com/ | JSConf http://jsconf.com/ | RobotsConf http://robotsconf.com/ | RobotsWeekly http://robotsweekly.com/

Help me end the negativity on the internet, share this http://jsconf.eu/2011/an_end_to_negativity.html.

On Tue, Aug 5, 2014 at 3:36 AM, marcoschwartz notifications@github.com wrote:

Hello, I just re installed everything on my Raspberry Pi and I can't install node-serialport anymore. I am running the latest version of Debian Wheezy, node & npm (installed by following your instructions). This is what I got after doing a npm install serialport:

serialport@1.4.5 install /home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport node-pre-gyp install --fallback-to-build

EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.29" gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/.node-gyp" WARN install got an error, rolling back install install got an error, rolling back install ERR! configure error- stack Error: unexpected eof gyp ERR! stack at decorate (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/abstract.js:67:36) gyp ERR! stack at Extract.Abstract.error (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/abstract.js:61:12) gyp ERR! stack at Extract._streamEnd (/usr/local/lib/node_modules/npm/node_modules/tar/lib/extract.js:75:22) stack at BlockStream. (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:50:8) gyp ERR! stack at BlockStream.emit (events.js:92:17) ERR! stack at BlockStream._emitChunk (/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:203:10) stack at BlockStream.resume (/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:58:15) gyp ERR! stack at Extract.Reader.resume (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/reader.js:253:34) stack at Entry. (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:256:8) gyp ERR! stack at Entry.emit (events.js:92:17) gyp ERR! System Linux 3.12.22+ "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.5" "--major=1" "--minor=4" "--patch=5" "--runtime=node" "--node_abi=node-v11" "--platform=linux" "--target_platform=linux" "--arch=arm" "--target_arch=arm" "--module_main=./serialport" "--host= https://node-serialport.s3.amazonaws.com/" "--module_path=/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-linux-arm" "--remote_path=./serialport/v1.4.5/Release/" "--package_name=node-v11-linux-arm.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz" "--hosted_path= https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/" "--hosted _tarball= https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz " gyp ERR! cwd /home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport v0.10.29e -v| ERR! node-gyp -v v0.13.1 gyp ERR! not ok ERR! build error ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=linux --target_platform=linux --arch=arm --target_arch=arm --module_main=./serialport --host= https://node-serialport.s3.amazonaws.com/ --module_path=/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-linux-arm --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-linux-arm.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz --hosted_path= https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball= https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Rel%20ease/node-v11-linux-arm.tar.gz' (1) at ChildProcess. (/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17) ERR! stack at maybeClose (child_process.js:755:16) at Process.ChildProcess._handle.onexit (child_process.js:822:5) node-pre-gyp ERR! System Linux 3.12.22+ "node" "/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" cwd /home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport node-pre-gyp ERR! node -v v0.10.29 ERR! node-pre-gyp -v v0.5.19 ode-pre-gyp ERR! not ok| Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=linux --target_platform=linux --arch=arm --target_arch=arm --module_main=./serialport --host= https://node-serialport.s3.amazonaws.com/ --module_path=/home/pi/work/home-automation-arduino/chapter4/interface/node_modules/arest/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-linux-arm --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-linux-arm.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz --hosted_path= https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball= https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-linux-arm.tar.gz https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-linux%20-arm.tar.gz' (1) npm ERR! serialport@1.4.5 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the serialport@1.4.5 install script. 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! System Linux 3.12.22+ npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "arest" npm ERR! cwd /home/pi/work/home-automation-arduino/chapter4/interface npm ERR! node -v v0.10.29 npm ERR! npm -v 1.4.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pi/work/home-automation-arduino/chapter4/interface/npm-debug.log npm ERR! not ok code 0

What can I do ?

— Reply to this email directly or view it on GitHub https://github.com/voodootikigod/node-serialport/issues/368.

marcoschwartz commented 10 years ago

I tried this, same issue. Actually I was able to check that it is a version problem, as sudo npm install serialport@1.4.2 works perfectly

voodootikigod commented 10 years ago

Interesting. Thanks for the details will dig into it.

On Wednesday, August 6, 2014, marcoschwartz notifications@github.com wrote:

I tried this, same issue. Actually I was able to check that it is a version problem, as sudo npm install serialport@1.4.2 works perfectly

— Reply to this email directly or view it on GitHub https://github.com/voodootikigod/node-serialport/issues/368#issuecomment-51358462 .

Chris Williams

@voodootikigod http://twitter.com/voodootikigod | GitHub http://github.com/voodootikigod

The things I make that you should check out: SaferAging http://www.saferaging.com/ | JSConf http://jsconf.com/ | RobotsConf http://robotsconf.com/ | RobotsWeekly http://robotsweekly.com/

Help me end the negativity on the internet, share this http://jsconf.eu/2011/an_end_to_negativity.html.

ianlewis commented 9 years ago

I get have a similar problem when installing the newest version (1.7.4). In my case I get an error not from configure, but from make.

root@raspberrypi:/usr/local/lib/node_modules# npm install -g serialport /usr/local/bin/serialportlist -> /usr/local/lib/node_modules/serialport/bin/serialportList.js /usr/local/bin/serialportterm -> /usr/local/lib/node_modules/serialport/bin/serialportTerminal.js

serialport@1.7.4 install /usr/local/lib/node_modules/serialport node-pre-gyp install --fallback-to-build

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.12.6" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/serialport/.node-gyp" make: Entering directory '/usr/local/lib/node_modules/serialport/build' make: *\ No rule to make target '../.node-gyp/0.12.6/common.gypi', needed by 'Makefile'. Stop. make: Leaving directory '/usr/local/lib/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:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Linux 3.18.11-v7+ 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/serialport/build/serialport/v1.7.4/Release/node-v14-linux-arm/serialport.node" "--module_name=serialport" "--module_path=/usr/local/lib/node_modules/serialport/build/serialport/v1.7.4/Release/node-v14-linux-arm" gyp ERR! cwd /usr/local/lib/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 build --fallback-to-build --module=/usr/local/lib/node_modules/serialport/build/serialport/v1.7.4/Release/node-v14-linux-arm/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/serialport/build/serialport/v1.7.4/Release/node-v14-linux-arm' (1) node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/serialport/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_process.js:1087:5) node-pre-gyp ERR! System Linux 3.18.11-v7+ node-pre-gyp ERR! command "node" "/usr/local/lib/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /usr/local/lib/node_modules/serialport node-pre-gyp ERR! node -v v0.12.6 node-pre-gyp ERR! node-pre-gyp -v v0.6.7 node-pre-gyp ERR! not ok 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_modules/serialport/build/serialport/v1.7.4/Release/node-v14-linux-arm/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/serialport/build/serialport/v1.7.4/Release/node-v14-linux-arm' (1) npm ERR! Linux 3.18.11-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "serialport" npm ERR! node v0.12.6 npm ERR! npm v2.11.2 npm ERR! code ELIFECYCLE

npm ERR! serialport@1.7.4 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the serialport@1.7.4 install script 'node-pre-gyp install --fallback-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! /usr/local/lib/node_modules/npm-debug.log

bombarie commented 9 years ago

Try adding '--unsafe-perm' to your command. I encountered this npm switch on StackOverflow and it remedies the 'user "root" does not have permission to access the dev dir "/root/.node-gyp/0.xx.xx"' error.

I can't say if this is an ugly workaround (well, it's a workaround for sure), but adding the switch allows make to do its thing without errors.

ianlewis commented 9 years ago

I just tried this and it does seem to work installing globally as root with --unsafe-perm