Contextify install fails - "node: not found" - node.js

I cannot get Contextify to install on my system. I am running Ubuntu 14.04, node.js version 0.10.25, npm version 1.3.10, with node-gyp version 0.10.10
I've tried upgrading, restarting, installing dependencies first, everything. Nothing will get it to work.
~$ sudo npm install -g contextify
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan
> contextify#0.1.8 install /usr/local/lib/node_modules/contextify
> node-gyp rebuild
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' 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/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-29-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/contextify
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
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! weird error 1
npm ERR! not ok code 0

I had the same problem. Apparently Debian has renamed the command node to nodejs which is causing the problem. For me installing nodejs-legacy fixed the issue.
sudo apt-get update && sudo apt-get install nodejs-legacy
See https://github.com/voodootikigod/node-serialport/issues/301 for details.

Related

ERR! stack Error: `gyp` failed with exit code: 1

Issues with my MAC forced me to have to format and start fresh. I uploaded my project to GITHUB and downloaded it after installing NPM 6.9.0 & Node 12.6.0. Nothing works and i keep getting this gyp error:
gyp: Call to 'node findJavaHome.js' returned exit status 1 while in binding.gyp. 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:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/anonymous/Development/Mundo1.6/node_modules/java
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java#0.11.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java#0.11.0 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:
I'm not sure what to do at this point...I've tried all of the suggestions I've seen online:
sudo npm install --unsafe-perm
sudo node-gyp rebuild -g --unsafe-perm
sudo chmod 777
sudo node-gyp rebuild -g --unsafe-perm
sudo npm config set unsafe-perm=true
npm rebuild node-sass
Any help would be greatly appreciate at this point. Again, I had to format in order to upgrade my MAC os Mojave 10.14.5
I've never had to constantly use sudo with NPM in the past so I'm not sure what went wrong.
For me it was updating the node-sass version (I was getting this error while installing node package manager packages for Angular) from 4.9.3 to 4.13.1

node-gyp rebuild error while installing node modules

I tried installing zerorpc package on node using 'npm install zerorpc' and I am getting following error. The error is because node-gyp fails to rebuild.
npm http GET https://registry.npmjs.org/zerorpc
npm http 304 https://registry.npmjs.org/zerorpc
npm http GET https://registry.npmjs.org/underscore/1.3.3
npm http GET https://registry.npmjs.org/node-uuid/1.3.3
npm http GET https://registry.npmjs.org/msgpack/1.0.2
npm http GET https://registry.npmjs.org/zmq
npm http 304 https://registry.npmjs.org/node-uuid/1.3.3
npm http 304 https://registry.npmjs.org/msgpack/1.0.2
npm http 304 https://registry.npmjs.org/zmq
npm http 304 https://registry.npmjs.org/underscore/1.3.3
npm WARN engine msgpack#1.0.2: wanted: {"node":">=0.12.7"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan
> zmq#2.14.0 install /home/deepu/node_modules/zerorpc/node_modules/zmq
> node-gyp rebuild
> msgpack#1.0.2 install /home/deepu/node_modules/zerorpc/node_modules/msgpack
> node-gyp rebuild
make: Entering directory `/home/deepu/node_modules/zerorpc/node_modules/zmq/build'
CXX(target) Release/obj.target/zmq/binding.o
make: Entering directory `/home/deepu/node_modules/zerorpc/node_modules/msgpack/build'
CC(target) Release/obj.target/libmsgpack/deps/msgpack/objectc.o
CC(target) Release/obj.target/libmsgpack/deps/msgpack/unpack.o
CC(target) Release/obj.target/libmsgpack/deps/msgpack/vrefbuffer.o
CC(target) Release/obj.target/libmsgpack/deps/msgpack/zone.o
CC(target) Release/obj.target/libmsgpack/deps/msgpack/version.o
AR(target) Release/obj.target/deps/msgpack/msgpack.a
COPY Release/msgpack.a
CXX(target) Release/obj.target/msgpackBinding/src/msgpack.o
../src/msgpack.cc: In function ‘void v8_to_msgpack(v8::Handle<v8::Value>, msgpack_object*, msgpack_zone*, size_t)’:
../src/msgpack.cc:126:93: error: could not convert ‘v8obj’ from ‘v8::Handle<v8::Value>’ to ‘v8::Local<v8::Value>’
mo->via.str.size = static_cast<uint32_t>(Nan::DecodeBytes(v8obj, Nan::Encoding::UTF8));
^
../src/msgpack.cc:129:94: error: could not convert ‘v8obj’ from ‘v8::Handle<v8::Value>’ to ‘v8::Local<v8::Value>’
Nan::DecodeWrite((char*)mo->via.str.ptr, mo->via.str.size, v8obj, Nan::Encoding::UTF8);
^
../src/msgpack.cc:136:94: error: could not convert ‘result’ from ‘v8::Handle<v8::Value>’ to ‘v8::Local<v8::Value>’
mo->via.str.size = static_cast<uint32_t>(Nan::DecodeBytes(result, Nan::Encoding::UTF8));
^
../src/msgpack.cc:139:95: error: could not convert ‘result’ from ‘v8::Handle<v8::Value>’ to ‘v8::Local<v8::Value>’
Nan::DecodeWrite((char*)mo->via.str.ptr, mo->via.str.size, result, Nan::Encoding::UTF8);
^
make: *** [Release/obj.target/msgpackBinding/src/msgpack.o] Error 1
make: Leaving directory `/home/deepu/node_modules/zerorpc/node_modules/msgpack/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.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-60-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/deepu/node_modules/zerorpc/node_modules/msgpack
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
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! weird error 1
Assembler messages:
Fatal error: can't create Release/obj.target/zmq/binding.o: No such file or directory
make: *** [Release/obj.target/zmq/binding.o] Error 1
make: Leaving directory `/home/deepu/node_modules/zerorpc/node_modules/zmq/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.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-60-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/deepu/node_modules/zerorpc/node_modules/zmq
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
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! not ok code 0
Then I tried to update the version using
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
given by https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version but I am getting 'bash: /usr/bin/node: No such file or directory' error
I upgraded it to 4.3.0 version using
sudo npm cache clean -f
sudo npm install -g n
sudo n 4.3.0
and then I used
sudo npm install zerorpc
and it worked!
As for the bash: '/usr/bin/node: No such file or directory' error, I did
sudo apt-get install node-legacy

NPM fails installing zmq on OSX 10.9.5

I'm getting this error:
/bin/sh: pkg-config: command not found
gyp: Call to 'pkg-config libzmq --libs' returned exit status 127. while trying to load binding.gyp
I've tried upgrading nodejs to 5.1.0.
I've tried downgrading nodejs to 4.2.2.
I've tried completely removing nodejs manually then re-installing 4.2.2 and trying again.
I've tried the removal script here:
https://gist.github.com/brock/5b1b70590e1171c4ab54
Then re-installing each version and trying again.
I've tried downgrading to zeromq 4.0.7.
No luck.
Here's the complete error:
localhost:~ user$ npm install zmq
/
> zmq#2.14.0 install /Users/user/node_modules/zmq
> node-gyp rebuild
/bin/sh: pkg-config: command not found
gyp: Call to 'pkg-config libzmq --libs' 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:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/user/node_modules/zmq
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 13.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "zmq"
npm ERR! node v4.2.2
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! zmq#2.14.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zmq#2.14.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the zmq 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 zmq
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/user/npm-debug.log
Here's what worked...
install zmq using brew : brew install zmq
export PKG_CONFIG_PATH=/usr/local/Cellar/zeromq/4.0.4/lib/pkgconfig/
sudo visudo
add the line Defaults env_keep += "PKG_CONFIG_PATH"
sudo npm install zmq
Here is how I fixed it:
Step 1:
brew install zmq
Step 2:
export PKG_CONFIG_PATH=/usr/local/Cellar/zeromq/4.2.5/lib/pkgconfig/
(Note: zeromq Version 4.2.5 in path above will need to be changed to whatever version you installed)
Step 3:
sudo visudo
and add
Defaults env_keep += "PKG_CONFIG_PATH"
Step 4:
In package.json > dependencies, add:
"zmq": "^2.15.3"
Step 5:
Run yarn or npm install

Bcrypt fails to install [duplicate]

This question already has answers here:
Cannot install packages using node package manager in Ubuntu
(19 answers)
Closed 2 years ago.
I am having problems installing an npm package called "bcrypt" on my Ubuntu system.
This is what I did:
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install bcrypt
This is what I got:
when typing: sudo npm install bcrypt
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http GET https://registry.npmjs.org/nan/1.3.0
npm http 304 https://registry.npmjs.org/nan/1.3.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0
> bcrypt#0.8.0 install /home/gatsu/salongapp/salongapp/node_modules/bcrypt
> node-gyp rebuild
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' 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/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-35-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/gatsu/salongapp/salongapp/node_modules/bcrypt
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
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! weird error 1
npm ERR! not ok code 0
The package does not get placed in this folder:
/home/gatsu/salongapp/salongapp/node_modules/bcrypt
Any thoughts?
in ubuntu if you install nodejs using apt, the command for nodejs will be nodejs while commonly command line name used for nodejs is node.
Here, bcrypt assumes the command as node which is not available.
Try setting alias for nodejs as node like this
alias node='nodejs'
and then try to install bcrypt
sudo npm install bcrypt
U can set aliases in .bash_aliases file in home folder to permanently set the alias node.

Error while trying to install nodejs pm2 module

I'm trying to install pm2 module, but I'm facing this error. OS is Ubuntu 14.04 Beta2.
Node.js version is 0.10.25, npm - 1.4.7.
What am I doing wrong?
halkar#halkar-nb-ubuntu:~/source$ sudo npm install pm2 -g
.......
npm http 304 https://registry.npmjs.org/fsevents
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/recursive-readdir
npm http 304 https://registry.npmjs.org/configurable
npm WARN optional dep failed, continuing fsevents#0.2.0
> usage#0.3.9 install /usr/lib/node_modules/pm2/node_modules/usage
> node-gyp rebuild
Usage: gyp_main.py [options ...] [build_file ...]
gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-19-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/pm2/node_modules/usage
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/escape-regexp
npm http 304 https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/mkdirp
npm ERR! usage#0.3.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
As a workaround, removing gyp solved this problem for me:
sudo apt-get remove gyp
Here is the issue itself listed in pm2 repository:
https://github.com/Unitech/pm2/issues/434

Resources