Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with node 8.0.0 #19

Closed
mortie opened this issue Jun 7, 2017 · 10 comments
Closed

Doesn't work with node 8.0.0 #19

mortie opened this issue Jun 7, 2017 · 10 comments

Comments

@mortie
Copy link

mortie commented Jun 7, 2017

The console output from sudo npm install -g udev

> [email protected] install /usr/lib/node_modules/udev
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https:///node-v57-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 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/8.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/udev/.node-gyp"
make: Entering directory '/usr/lib/node_modules/udev/build'
make: *** No rule to make target '../.node-gyp/8.0.0/include/node/common.gypi', needed by 'Makefile'.  Stop.
make: Leaving directory '/usr/lib/node_modules/udev/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Linux 4.11.3-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/lib/node_modules/udev/build/node-v57-linux-x64/udev.node" "--module_name=udev" "--module_path=/usr/lib/node_modules/udev/build/node-v57-linux-x64"
gyp ERR! cwd /usr/lib/node_modules/udev
gyp ERR! node -v v8.0.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/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/udev/build/node-v57-linux-x64/udev.node --module_name=udev --module_path=/usr/lib/node_modules/udev/build/node-v57-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/udev/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:887:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
node-pre-gyp ERR! System Linux 4.11.3-1-ARCH
node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/udev/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/udev
node-pre-gyp ERR! node -v v8.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/udev/build/node-v57-linux-x64/udev.node --module_name=udev --module_path=/usr/lib/node_modules/udev/build/node-v57-linux-x64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-06-07T07_23_31_692Z-debug.log

@mortie
Copy link
Author

mortie commented Jun 7, 2017

Here's the log file the error is talking about:
2017-06-07T07_23_31_692Z-debug.log.txt

@cheery
Copy link
Owner

cheery commented Jun 7, 2017

These are the interesting lines. Especially the one about permissions.

node-pre-gyp ERR! Tried to download: https:///node-v57-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 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/8.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/udev/.node-gyp"

@nbroeking
Copy link

nbroeking commented Jun 27, 2017

@mortie

This normally happens when trying to do the install offline. This udev module depends on the prebuilt c++ node headers. You need to the build once on the internet or you need pre download the files into the .node-gyp folder. This is an issue with the environment of the machine not with the udev module.

@zoutepopcorn
Copy link

@nbroeking or @cheery are you able to install and run on a rPi with node 8.x?

I've got a lot of errors, most the same as above

I had it working before, but I broke my SD card. Can't remember how it worked :(.

@cheery
Copy link
Owner

cheery commented Jul 5, 2018

@zoutepopcorn I will try this. It's been a while I've popped up rPi and used it for something. I probably use the newest one I have, it's probably rPi 2 or rPi 3. I'll tell how it went later this week.

@zoutepopcorn
Copy link

Maybe this did the trick last time

rm -rf ~/.node-gyp

But have to test it later on the pi

@cheery
Copy link
Owner

cheery commented Jul 8, 2018

@zoutepopcorn I loaded raspbian lite version and tried things out. Here's what I found out.

It would appear that debian renames node to nodejs because Node developers were naive in choosing their executable name on Linux platforms. The installation scripts still try to use the node command, but they find the software that debian calls node. That can cause this to fail, but it would fail earlier. Your script shows that it already gets to build the module.

I skipped the issue by adding a symbolic link node -> /usr/bin/nodejs into a directory, then I exported that directory to a PATH environment variable.

Another thing I did was I installed udev C headers with the following apt command:

sudo apt-get install lib-udev-dev

Then it worked. Though the steps I took didn't reproduce this issue. Unless it's the same problems as here, just manifesting in some illegible manner.

@zoutepopcorn
Copy link

Great.

This article pointed me howto install:

https://community.roonlabs.com/t/howto-powermate-extension-on-a-raspberry-pi/23819

You can get your nodejs info to install on the pi using:

cat /proc/cpuinfo

And then download the right one

wget https://nodejs.org/dist/v7.8.0/node-v7.8.0-linux-armv7l.tar.gz

@mortie is this working for you?

@jacobq
Copy link

jacobq commented Oct 14, 2019

I think this issue can be closed. I just tried compiling it on an RPi 4 running the latest Raspbian (September 2019) with the latest 8.x (8.16.2) and it seems to work fine. Also builds for 10.x though not for 12.x, which is being tracked in #30

@cheery
Copy link
Owner

cheery commented Oct 14, 2019

You're right. Lets close it.

@cheery cheery closed this as completed Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants