npm install webdriver-sync fails - node.js

I'm running nodejs v0.12.2 on a RHEL 6.5 host. And I'm trying to install the webdriver-sync module with npm.
But when I go to do the install I'm running into this error:
root#206459673 ~]# npm install webdriver-sync
npm WARN package.json assert#1.3.0 assert is also the name of a node core module.
npm WARN package.json sqwish#0.2.2 No repository field.
> java#0.5.3 install /root/node_modules/webdriver-sync/node_modules/java
> node-gyp rebuild
[node-java] Error: not found: javac
gyp: Call to 'node findJavaHome.js' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
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 2.6.32-431.29.2.el6.x86_64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/webdriver-sync/node_modules/java
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
> selenium-binaries#0.3.6 install /root/node_modules/webdriver-sync/node_modules/selenium-binaries
> node ./lib/install.js
[selenium-binaries] Downloading selenium
[selenium-binaries] http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar
[selenium-binaries] -> /root/node_modules/webdriver-sync/node_modules/selenium-binaries/lib/selenium-binaries/selenium/2.45.0
[selenium-binaries] Status: 35269077 of 35269077
[selenium-binaries] Finished downloading http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar
[selenium-binaries] Downloading chromedriver
[selenium-binaries] http://chromedriver.storage.googleapis.com/2.15/chromedriver_linux64.zip
[selenium-binaries] -> /root/node_modules/webdriver-sync/node_modules/selenium-binaries/lib/selenium-binaries/chromedriver/2.15
[selenium-binaries] Status: 2281614 of 2281614
[selenium-binaries] Finished downloading http://chromedriver.storage.googleapis.com/2.15/chromedriver_linux64.zip
npm ERR! Linux 2.6.32-431.29.2.el6.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriver-sync"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! java#0.5.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java#0.5.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the java package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls java
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/npm-debug.log
Could anyone offer some advice on how to get past this error?
Thanks!!

I've just verified the suggestion that I made in my comment to the question. Installing an openjdk-devel package will allow you to install this package, as they're the packages that provide the javac command.
On CentOS 6.6 (I imagine CentOS 6.5 is pretty much the same in this regard), the following packages are available from the default repositories (you'll see a different extension than x86_64, if you're on a different architecture):
================== N/S Matched: openjdk-devel ===================
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
I ran sudo yum install java-1.8.0-openjdk-devel, then the webdriver-sync module from npm installed just fine.

Related

install of node-red-contrib-i2c fails with NPM

I have been having problems with my node red installation and the install of additional node packages...I am trying to install the node-red-contrib-i2c package on Raspberry PI http://flows.nodered.org/node/node-red-contrib-i2c ...this is my console output:
pi#raspberrypi:~ $ npm install node-red-contrib-i2c
more console output...then error:
make: Leaving directory '/home/pi/node_modules/node-red-contrib-i2c/node_modules/i2c/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.4.50-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/node_modules/node-red-contrib-i2c/node_modules/i2c
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! i2c#0.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c#0.2.3 install script.
npm ERR! This is most likely a problem with the i2c package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls i2c
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.50-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-red-contrib-i2c"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm ERR! not ok code 0
Something similar happens with several other packages that I have also tried to install including the MCP3008 ADC node package.
Delete your $HOME/.node-gyp.
It should fix your problem
Ok so I ended up solving the problem. What was happening is that the nodejs version that comes pre-installed with the PI is an older version and needs to be upgraded in order to install this particular node for node red so I used:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install nodejs
This upgrades the nodejs version to version 6 from 0.10.29. 0.10.29 is in the standard Raspberry PI Jessie installation at the time of this writing. Then the installation of the node-red I2C works just fine.

node-gyp rebuild fails while installing node modules

I am trying to install node_xslt module in node 0.12 but it is failing. I have python version 2.7 and node-gyp version 2.0.2.
Here is the error stack-
> node_xslt#0.1.9 preinstall /home/ritesh/Ritesh/projects/applane1/node_modules/node_xslt
> node-gyp rebuild
/bin/sh: 1: xml2-config: not found
gyp: Call to 'xml2-config --cflags' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
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.13.0-32-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ritesh/Ritesh/projects/applane1/node_modules/node_xslt
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node_xslt"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! node_xslt#0.1.9 preinstall: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node_xslt#0.1.9 preinstall script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node_xslt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node_xslt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /node_modules/npm-debug.log
This error comes while installing other modules as well i.e. xslt4node.
Just had the same problem, though the question is 5+ years old, might be useful for somebody else. I solved my problem switching to a different version of node with nvm: nvm use 12 in my case.
Try installing compile tools
sudo apt-get install python3 g++ make python3-pip
Works for me
Try installing sudo apt-get install libxml2-dev

"node build.js" fails when trying to install grunt-sass

I'm trying to switch from grunt-contrib-sass to grunt-sass, but I'm running into build errors related to node-sass inside the grunt wrapper module. So far I've upgraded node from 0.10.40 to 0.12.7 and switched to Python 2.7 in order to bypass a few other others, but this is what remains:
$ npm install
> node-sass#1.0.3 install /var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass
> node build.js
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass/build'
CXX(target) Release/obj.target/binding/binding.o
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-std=c++11"
make: *** [Release/obj.target/binding/binding.o] Error 1
make: Leaving directory `/var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass/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 2.6.18-274.18.1.el5.centos.plus
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
Build failed
npm ERR! Linux 2.6.18-274.18.1.el5.centos.plus
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! node-sass#1.0.3 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#1.0.3 install script 'node build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/example.com/www/npm-debug.log
Additional version info:
$ node -v
v0.12.7
$ node -v
v0.12.7
$ npm -v
2.11.3
$ cat /etc/redhat-release
CentOS release 5.11 (Final)
I'm a bit out of my depth on troubleshooting Node.js compatibility problems. While this is on a shared dev environment, I'm willing to try just about anything short of massive global change like upgrading the OS.
Update: I've since solved this by manually removing node-sass and node-gyp from the local node_modules folder. After that running npm install ran without errors. I think those modules were leftover from earlier attempts (before upgrading node.js and Python, most likely).

Install Node Canvas With NPM Not Working

I am trying to install node-canvas on CentOs 6 with LAMP. I have already installed and updated Node JS to the latest, as well as nmp.
When i run the command: npm install canvas i just get the following errors:
[root#localhost tmp]# sudo npm install canvas
> canvas#1.2.1 install /tmp/node_modules/canvas
> node-gyp rebuild
Package pangocairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `pangocairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pangocairo' found
gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 2.6.32-504.8.1.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/node_modules/canvas
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 2.6.32-504.8.1.el6.x86_64
npm ERR! argv "node" "/usr/bin/npm" "install" "canvas"
npm ERR! node v0.10.36
npm ERR! npm v2.7.1
npm ERR! code ELIFECYCLE
npm ERR! canvas#1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas#1.2.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls canvas
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/npm-debug.log
you need to install cairo and a few other libraries before you can install node canvas.
Just use the command below:
yum install -y cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel

Error: not found: make

I can't install any packages that requires node-gyp. The error message goes like this
$ npm install node-protobuf
info trying registry request attempt 1 at 22:43:57
http GET https://registry.npmjs.org/node-protobuf
http 200 https://registry.npmjs.org/node-protobuf
npm http GET https://registry.npmjs.org/node-protobuf/-/node-protobuf-1.0.8.tgz
npm http 200 https://registry.npmjs.org/node-protobuf/-/node-protobuf-1.0.8.tgz
> node-protobuf#1.0.8 install /home/whs/node_modules/node-protobuf
> node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Linux 2.6.32-5-amd64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/whs/node_modules/node-protobuf
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! node-protobuf#1.0.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-protobuf#1.0.8 install script.
npm ERR! This is most likely a problem with the node-protobuf package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-protobuf
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-5-amd64
npm ERR! command "node" "/usr/local/bin/npm" "install" "node-protobuf"
npm ERR! cwd /home/whs/
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.15
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/whs/npm-debug.log
npm ERR! not ok code 0
I also tried the protobuf package and got the exact same result.
Most search result says that this error is from missing make but in my case I have make installed. The node installation is even built from source manually on the machine.
Additional info:
Path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Make: GNU Make 3.81 installed in /usr/bin/make (from official Debian package)
Distro: Debian 6.0.8
Arch: amd64
Build-essential package: installed
Node: Manually built from source
Installation of non-gyp packages: work normally
I have found that I set 0754 permission on /usr/bin/make and a bug in which skip the file due to user's primary group is not the same as make's. I have filed a bug in node-which.

Resources