Compilation error installing nodetime - node.js

I'm trying to install the nodetime module (for node), but when I do, I get the following compilation error:
make: *** [Release/obj.target/nodetime_native/src/nodetime_native.o]
Error 1 make: Leaving directory
/home/fernando/node_modules/nodetime-native/build' gyp ERR! build
error gyp ERR! stack Error:make` failed with exit code: 2 gyp ERR!
stack at ChildProcess.onExit
(/home/fernando/apps/node-v0.12.2/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.13.0-53-generic gyp
ERR! command "node"
"/home/fernando/apps/node-v0.12.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"rebuild" gyp ERR! cwd /home/fernando/node_modules/nodetime-native gyp
ERR! node -v v0.12.2 gyp ERR! node-gyp -v v1.0.3 gyp ERR! not ok npm
ERR! Linux 3.13.0-53-generic npm ERR! argv "/usr/local/bin/node"
"/usr/local/bin/npm" "i" "nodetime-native" npm ERR! node v0.12.2 npm
ERR! npm v2.7.4 npm ERR! code ELIFECYCLE
npm ERR! nodetime-native#0.1.0 install: node-gyp rebuild npm ERR!
Exit status 1 npm ERR! npm ERR! Failed at the nodetime-native#0.1.0
install script 'node-gyp rebuild'. npm ERR! This is most likely a
problem with the nodetime-native 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 nodetime-native npm ERR! There is likely
additional logging output above.
Looking around, it would seem like I need to have Python installed, which I do (both 2.7 and 3.4) and make and gcc, which I do.
What else could be happening here?

You also need to make sure the Python executable you reach via your PATH environment variable leads to the 2.x version.
I believe node-gyp isn't working well with the 3.x version of Python.

Related

npm install fails with node-gyp build error

Today when I run npm install, it fails and gives me the following error log. I know it's an issue with hashtable but I have never had this issue before.
> hashtable#2.0.2 install /Users/admin/myproject/node_modules/hashtable
> node-gyp configure build
CXX(target) Release/obj.target/native/src/hashtable.o
SOLINK_MODULE(target) Release/native.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/native.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/admin/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
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 15.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/admin/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/admin/myproject/node_modules/hashtable
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
myproject#0.0.1 /Users/admin/myproject
└── (empty)
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/Users/admin/.npm-packages/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! hashtable#2.0.2 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hashtable#2.0.2 install script 'node-gyp configure build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hashtable package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs hashtable
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls hashtable
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/admin/myproject/npm-debug.log
npm ERR! code 1
I thought there might be a problem with node-gyp so I did a npm install node-gyp -g separately but the issue did not go away. Does anyone know how to resolve this?
By the way, I am on Mac,running OSX 10.11.5, also recently installed XCode 6.3.2 for a separate project and can only use this version of XCode, not sure if that is causing the problem.
node-gyp also requires python and xcode on MacOs for C++ compilation. There are similar requirements for other systems.
You can find the pre-reqs for the node-gyp package on its npm page here.

How to install npm install xbox-controller in ubuntu?

I have used johnny-five to blink a led with a button. I want to blink it with a button of the xBox pad so I found npm xbox-controller but I cannot install it in Ubuntu 14.04. I get this error:
**compilation terminated.
make: *** [Release/obj.target/hidapi/hidapi/libusb/hid.o] Error 1
make: Leaving directory `/home/villalpando/xbox/node_modules/node-hid/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/npm/node_modules/node-gyp/lib/build.js:269: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 Linux 3.16.0-37-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "install"
gyp ERR! cwd /home/villalpando/xbox/node_modules/node-hid
gyp ERR! node -v v0.10.38
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Linux 3.16.0-37-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "node-hid"
npm ERR! node v0.10.38
npm ERR! npm v2.9.0
npm ERR! code ELIFECYCLE
npm ERR! node-hid#0.3.2 install: `sh install.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-hid#0.3.2 install script 'sh install.sh'.
npm ERR! This is most likely a problem with the node-hid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! sh install.sh
npm ERR! You can get their info via:
npm ERR! npm owner ls node-hid
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/villalpando/xbox/npm-debug.log**
Is there another way to do it?
I found the answer here http://www.codeitive.com/0zzejPjkVg/npm-fail-to-install-nodehid-faild-to-install-last-version-of-nodejs.html it seems that my node.js was just too old to support node-hid thanks

Node-gyp 0.12.0 not found

When I attempt to install memwatch from npm with npm install memwatch I receive these errors before it fails completely:
gyp WARN EACCES user does not have permission to access the dev dir "~/.node-gyp/0.12.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/var/folders/bf/_rxhpvq936b1vxf9ylygj86r0000gn/T/.node-gyp"
and
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:1067:12)
gyp ERR! System Darwin 14.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/cmlewis95/Dropbox/Programming/Projects/Markdown/node_modules/memwatch
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "memwatch"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! memwatch#0.2.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the memwatch#0.2.2 install script 'node-gyp rebuild'.
When I go to the location which it says it doesn't have access to, the version number listed in the error is not a directory. I only have a 0.10.13 folder there. I assumed I just needed to update node-gyp but all of the documentation I found on that did not solve the issue. Thanks.
If you happened to use Window, make it sure your opening commanding prompt as administrators access. By most chances if you using either Linux or OSX, try add a prefix sudo in front of your command,
sudo npm install memwatch

Raspberry Pi opencv 3 and node-opencv

I successfully compiled opencv 3 on my raspberry pi raspbian system. Now i am trying since ages to get node-opencv to install but with not much success.
Here is the error output from npm
npm install -g opencv
|
opencv#1.0.0 install /usr/local/lib/node_modules/opencv
node-gyp rebuild
make: Entering directory '/usr/local/lib/node_modules/opencv/build'
CXX(target) Release/obj.target/opencv/src/init.o
In file included from ../src/init.cc:5:0:
../src/CascadeClassifierWrap.h:5:3: error: ‘CascadeClassifier’ in namespace ‘cv’ does not name a type
In file included from ../src/init.cc:6:0:
../src/VideoCaptureWrap.h:5:7: error: ‘VideoCapture’ in namespace ‘cv’ does not name a type
opencv.target.mk:99: recipe for target 'Release/obj.target/opencv/src/init.o' failed
make: *** [Release/obj.target/opencv/src/init.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/opencv/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:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.12.28+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/opencv
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! opencv#1.0.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opencv#1.0.0 install script.
npm ERR! This is most likely a problem with the opencv 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 opencv
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.12.28+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "opencv"
npm ERR! cwd /usr/local/include/opencv
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I really am out of ideas and would much apprichiate some major help here.
Thanks a lot
best regards Thomas
node-opencv does not fully support OpenCV 3.x yet. They mention it on the readme here. You should be able to install 2.4 on your RPi2 with this tutorial, or search that same site if you have an RPi3.

Error on `node-gyp rebuild` on the `base64#2.1.0 install`

Running 'sudo npm install' on MAC, I got the error about node-gyp rebuild on the base64#2.1.0 install. Any way to resolve this problem? Please help.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 69
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:810:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jepeng/Documents/huron/wx2-admin-web-client/node_modules/base64
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! base64#2.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the base64#2.1.0 install script.
npm ERR! This is most likely a problem with the base64 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 base64
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/jepeng/Documents/huron/wx2-admin-web-client
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I have resolved this issue by using older version of node v0.10.40
I was facing similar issue.
Followed the following steps to fix it on MacOS highSierra 10.13:
Downloaded command line tools (MacOS 10.13) for xcode and installed it. Download it from "https://developer.apple.com/download/more/"
Installed xcode 10.0 from the app store. Opened xcode and went through the regular configuration xcode does in the initial start up.
After this it started giving "xcode-select" path issue as stated in the description above. On running command "xcode-select --print-path" it was showing path as '/ Library/Developer/CommandLineTools', so i went ahead and tried "xcode-select --reset" after which the path changed to "/Applications/Xcode.app/Contents/Developer". Immediately after it the build started working without any issues.

Resources