Cannot install node-sass npm module - node.js

I'm attempting to install the npm module "node-sass" on my Ubuntu 14.04 distro.
When I run
node -v
I get
v0.10.32
However, when attempting to install node-sass and harp with this command:
sudo npm install -g harp
I get the following error:
child_process: customFds option is deprecated, use stdio instead.
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:722:7)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at maybeClose (child_process.js:999:16)
gyp ERR! stack at Socket.<anonymous> (child_process.js:1167:11)
gyp ERR! stack at Socket.emit (events.js:107:17)
gyp ERR! stack at Pipe.close (net.js:461:12)
gyp ERR! System Linux 3.13.0-36-generic
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/harp/node_modules/terraform/node_modules/node-sass
gyp ERR! node -v v0.13.0-pre
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
Build failed
npm ERR! node-sass#0.9.3 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#0.9.3 install script.
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! System Linux 3.13.0-36-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "harp"
npm ERR! cwd /home/colin
npm ERR! node -v v0.13.0-pre
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/colin/npm-debug.log
npm ERR! not ok code 0
Note that the error states that my node version is still v0.13.0-pre even though I switched to 0.10.32 with nvm.

Question is 3 years old, yet I have recently encountered same problem on osx trying to install harp and found no solution elsewhere.
After several attempts managed to solve the problem with --unsafe-perm modifier, like follow:
sudo npm install --global --unsafe-perm harp
Install went successful and everything works, hope that helps :)

Related

node-memwatch on node 4+? [duplicate]

When trying to install memwatch using "npm install memwatch", I get this error:
I have CentOS6 with python 2.6.6 installed on server.
memwatch#0.2.2 install
/home/[[username]]/public_html/sockets/node_modules/memwatch
node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT
gyp ERR! stack at errnoException (net.js:905:11)
gyp ERR! stack at Object.afterConnect as oncomplete
gyp ERR! System Linux 2.6.32-504.3.3.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"rebuild"
gyp ERR! cwd /home/[[username]]/public_html/sockets/node_modules/memwatch
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
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.
npm ERR! This is most likely a problem with the memwatch 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 memwatch
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-504.3.3.el6.x86_64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "memwatch"
npm ERR! cwd /home/[[username]]/public_html/sockets
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
Try
npm install memwatch-next
I think the old codebase is not updated to latest NPM/NodeJS

Error when using $ sudo npm install -g mean-cli

I'm newbie, I installed MEAN.JS Stack on ubuntu,
but when i using
$ sudo npm install -g mean-cli
I get this
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.13.0-80-generic
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/mean-cli/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! Error: 404 Not Found
npm ERR! at WriteStream.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/fetch.js:58:12)
npm ERR! at WriteStream.emit (events.js:117:20)
npm ERR! at evalmachine.<anonymous>:1609:14
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:102:5
npm ERR! at Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.13.0-80-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "mean-cli"
npm ERR! cwd /home/travis
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! not ok code 0
how can i fix this? Thanks.
The proplem is version of nodejs and npm, i was fied this, just update node.js and npm.
Please be sure that your internet connectivity is established.This error occurs due to failure of network connectivity

Cannot install ember-cli on mac OS X

When I try to install ember-cli via npm, following the official documentation, I get this error:
9 errors generated.
make: *** [Release/obj.target/bufferutil/src/bufferutil.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:270: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 14.5.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 /usr/local/lib/node_modules/ember-cli/node_modules/bufferutil
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ember-cli"
npm ERR! node v4.0.0
npm ERR! npm v3.3.5
npm ERR! code ELIFECYCLE
npm ERR! bufferutil#1.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bufferutil#1.1.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bufferutil 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 bufferutil
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/sandropalmieri/npm-debug.log
I 've tried several times running the command using sudo but still getting this kind of error. Any idea of what's going on? Can you please assist? Thanks
Try adding --no-optional to your npm install command.
Are you using npm 3.3.3? See issue here: https://github.com/ember-cli/ember-cli/issues/4873
install node
node -v
v12.14.1
which npm
/usr/local/bin/npm
npm -v
6.13.4
npm install --save core-js#^3
sudo npm install -g ember-cli
which ember
/usr/local/bin/ember
ember -v
ember-cli: 3.16.0
node: 12.16.1
os: darwin x64

Installing node-memwatch on CentOS 6, node-gyp rebuild error

When trying to install memwatch using "npm install memwatch", I get this error:
I have CentOS6 with python 2.6.6 installed on server.
memwatch#0.2.2 install
/home/[[username]]/public_html/sockets/node_modules/memwatch
node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT
gyp ERR! stack at errnoException (net.js:905:11)
gyp ERR! stack at Object.afterConnect as oncomplete
gyp ERR! System Linux 2.6.32-504.3.3.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"rebuild"
gyp ERR! cwd /home/[[username]]/public_html/sockets/node_modules/memwatch
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
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.
npm ERR! This is most likely a problem with the memwatch 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 memwatch
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-504.3.3.el6.x86_64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "memwatch"
npm ERR! cwd /home/[[username]]/public_html/sockets
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
Try
npm install memwatch-next
I think the old codebase is not updated to latest NPM/NodeJS

Error: "pre" versions of node cannot be installed, use the --nodedir flag instead

I'm trying to install opencv for node. I don't think this has anything to do with opencv directly, rather it has to do with node-gyp.
I had success in installing opencv on my mac but when I try to do the exact same on Ubuntu server I get the following error after doing 'npm install opnecv':
npm http GET https://registry.npmjs.org/opencv
npm http 304 https://registry.npmjs.org/opencv
> opencv#0.0.7 preinstall /home/demo/node_modules/opencv
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/node-gyp/lib/install.js:69:16)
gyp ERR! stack at Object.commands.forEach.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/node-gyp/lib/node-gyp.js:56:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/node-gyp/lib/configure.js:181:20)
gyp ERR! stack at /usr/local/lib/node_modules/node-gyp/lib/configure.js:101:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:538:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:96:17)
gyp ERR! stack at maybeClose (child_process.js:638:16)
gyp ERR! stack at Process._handle.onexit (child_process.js:680:5)
gyp ERR! System Linux 3.2.0-29-generic
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/demo/node_modules/opencv
gyp ERR! node -v v0.8.13-pre
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm ERR! opencv#0.0.7 preinstall: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the opencv#0.0.7 preinstall 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.2.0-29-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "opencv"
npm ERR! cwd /home/demo
npm ERR! node -v v0.8.13-pre
npm ERR! npm -v 1.1.63
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/demo/npm-debug.log
npm ERR! not ok code 0
I also tried downloading the source code and doing 'node-gyp rebuild' with similar results:
demo#camera:~/src/node$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp#0.7.1
gyp info using node#0.8.13-pre | linux | x64
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/node-gyp/lib/install.js:69:16)
gyp ERR! stack at Object.commands.forEach.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/node-gyp/lib/node-gyp.js:56:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/node-gyp/lib/configure.js:181:20)
gyp ERR! stack at /usr/local/lib/node_modules/node-gyp/lib/configure.js:101:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:538:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:96:17)
gyp ERR! stack at maybeClose (child_process.js:638:16)
gyp ERR! stack at Process._handle.onexit (child_process.js:680:5)
gyp ERR! System Linux 3.2.0-29-generic
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/demo/src/node
gyp ERR! node -v v0.8.13-pre
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
Has anyone had this issue before?
I was also able to solve this by upgrading my version of node to a stable version (e.g. not a "pre" version - your version is 0.8.13-pre) with the following:
sudo npm install -g n # install node version manager "n"
sudo n stable # install the latest stable version of node
Use npm install --nodedir=/path/to/node opencv, where /path/to/node is a path to current nodejs source code.
It happens because node-gyp can't find source to your custom build, and here is the discussion about it: https://github.com/TooTallNate/node-gyp/issues/86
You can commonly fix this by creating a symbolic link if you have super user permissions.
chmod a+r /path/to/node -R
cd /usr/lib
sudo ln -s /path/to/node node
Then npm install again, and it will likely find it. Don't do this if /usr/lib/node already exists, as other software may depend on it.

Resources