After installing OS X Mountain Lion and XCode, I'm getting this error:
Jonathans-MacBook-Air:fme jong$ npm install bcrypt
npm http GET https://registry.npmjs.org/bcrypt/0.7.0
npm http 304 https://registry.npmjs.org/bcrypt/0.7.0
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0
> bcrypt#0.7.0 install /Users/jong/Workspace/fme/node_modules/bcrypt
> node-gyp rebuild
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
make: c++: No such file or directory
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 1
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:215:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Darwin 12.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jong/Workspace/fme/node_modules/bcrypt
gyp ERR! node -v v0.8.4
gyp ERR! node-gyp -v v0.6.1
gyp ERR! not ok
npm ERR! bcrypt#0.7.0 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the bcrypt#0.7.0 install script.
npm ERR! This is most likely a problem with the bcrypt 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 bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! cwd /Users/jong/Workspace/fme
npm ERR! node -v v0.8.4
npm ERR! npm -v 1.1.45
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/jong/Workspace/fme/npm-debug.log
npm ERR! not ok code 0
I have a feeling that it doesn't know which compiler to use. How do I fix this?
Apparently I just need to install the Command Line Tools from the downloads panel in XCode
xCode doesn't bundle command-line tools by default. Apple explains it in their documentation.
The problem may be that your Node.Js is version 0.10 and some modules only work with the previous 0.8.22 version which you can get here: http://blog.nodejs.org/2013/03/06/node-v0-8-22-stable/
Related
I want to install the rpi-gpio module to control the pins over HTTP, but when I install this module it throws the following error:
pi#raspberrypi:~/Desktop $ sudo npm install rpi-gpio
epoll#0.1.17 install /home/pi/node_modules/rpi-gpio/node_modules/epoll
node-gyp rebuild
make: Entering directory '/home/pi/node_modules/rpi-gpio/node_modules/epoll/build'
CXX(target) Release/obj.target/epoll/src/epoll.o
In file included from ../src/epoll.cc:15:0:
../node_modules/nan/nan.h:328:47: error: 'REPLACE_INVALID_UTF8' is not a member of 'v8::String'
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
epoll.target.mk:84: recipe for target 'Release/obj.target/epoll/src/epoll.o' failed
make: *** [Release/obj.target/epoll/src/epoll.o] Error 1
make: Leaving directory '/home/pi/node_modules/rpi-gpio/node_modules/epoll/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.1.17-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/node_modules/rpi-gpio/node_modules/epoll
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! epoll#0.1.17 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the epoll#0.1.17 install script.
npm ERR! This is most likely a problem with the epoll 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 epoll
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.1.17-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "rpi-gpio"
npm ERR! cwd /home/pi/Desktop
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/Desktop/npm-debug.log
npm ERR! not ok code 0
I am trying to install mmmagic with npm install and continue to get this error.
I have tried multiple versions of mmmagic as well as using node v0.10.40 & node v0.12.7, and reinstalling node-gyp.
I have cleared npm cache and destroyed the node_module folder multiple times.
Any ideas?
make: *** [Release/magic.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/XXXX/.nvm/v0.10.40/lib/node_modules/npm/node_modules/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:820:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "node" "/Users/XXXX/.nvm/v0.10.40/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/XXXX/Desktop/EdvisorIO/JJJJ/node_modules/mmmagic
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! mmmagic#0.3.16 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmmagic#0.3.16 install script.
npm ERR! This is most likely a problem with the mmmagic 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 mmmagic
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 15.0.0
npm ERR! command "/Users/XXXX/.nvm/v0.10.40/bin/node" "/Users/XXXX/.nvm/v0.10.40/bin/npm" "install"
npm ERR! cwd /Users/XXXX/Desktop/EdvisorIO/JJJJ
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I have run into an unusal problem when trying to install pty.js using node:
If I run npm install pty.js I receive this error:
> node-gyp rebuild
CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:487:10: error: use of undeclared identifier 'openpty'
return openpty(amaster, aslave, name, (termios *)termp, (winsize *)winp);
^
../src/unix/pty.cc:533:10: error: use of undeclared identifier 'forkpty'
return forkpty(amaster, name, (termios *)termp, (winsize *)winp);
^
2 errors generated.
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
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: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 Darwin 13.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/otiswright/Developer/Projects/Web/Hatchway/node_modules/pty.js
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! pty.js#0.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pty.js#0.2.4 install script.
npm ERR! This is most likely a problem with the pty.js 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 pty.js
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "pty.js"
npm ERR! cwd /Users/otiswright/Developer/Projects/Web/Hatchway
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.5.0-alpha-4
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/otiswright/Developer/Projects/Web/Hatchway/npm-debug.log
npm ERR! not ok code 0
I have node-gyp installed am running OS X with xcode + commandlines installed.
I am not sure where the problem is occurring? Could be dependencies.
I had the same issue with a different node package devtools-terminal.
The problem is that a header file is configured incorrectly for OSX as explained here.
This is the work around I use:
mkdir /tmp/pty.js
git clone https://github.com/chjj/pty.js.git /tmp/pty.js
vi /tmp/pty.js/src/unix/pty.cc
replace line 39: #include <util.h> with #include "/usr/include/util.h"
npm install -g /tmp/pty.js
and now npm install -g devtools-terminal should work.
This way you fix the issue in pty.js and use your local copy as the dependency for the package you with to install.
Good luck!
When installing the zmq node module, I get the following error.
I have the latest stable version of node installed.
I am running a Mac on OS X 10.9.3
npm http GET https://registry.npmjs.org/zmq
npm http 304 https://registry.npmjs.org/zmq
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
> zmq#2.7.0 install /Users/mario/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:340:16)
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 Darwin 13.2.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mario/node_modules/zmq
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm ERR! zmq#2.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zmq#2.7.0 install script.
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! System Darwin 13.2.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "zmq"
npm ERR! cwd /Users/mario/messaging
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/mario/messaging/npm-debug.log
npm ERR! not ok code 0
Why do I get this error and what should I do to fix it?
Looks like you need to install pkg-config:
/bin/sh: pkg-config: command not found
Try brew install pkg-config
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.