1

I'm trying to install a project from GitHub and followed the installation instructions. When I run npm install in the project directory it's returning the error results below:

root@server:/var/www/nomp# npm install
npm WARN [email protected] package.json: bugs['name'] should probably be bugs['url']
npm http GET https://registry.npmjs.org/body-parser
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/bignum

npm ERR! Error: failed to fetch from registry: request
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1261:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /var/www/nomp/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.8.0-29-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/nomp
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: request
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/nomp/npm-debug.log
npm not ok

Does anybody know the issue? I just installed nodejs and npm so I have no idea why this would happen.

Edit (ran after setting registry):

npm WARN [email protected] package.json: bugs['name'] should probably be bugs['url']
npm http GET https://registry.npmjs.org/body-parser
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/bignum

npm ERR! Error: failed to fetch from registry: request
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1261:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /var/www/nomp/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.8.0-29-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/nomp
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: request
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/nomp/npm-debug.log
npm not ok
root@pool:/var/www/nomp# vi npm-debug.log
root@pool:/var/www/nomp# vi npm-debug.log
root@pool:/var/www/nomp# npm install
npm WARN [email protected] package.json: bugs['name'] should probably be bugs['url']
npm http GET https://registry.npmjs.org/body-parser
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/bignum

npm ERR! Error: failed to fetch from registry: request
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1261:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /var/www/nomp/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.8.0-29-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/nomp
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: request
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/nomp/npm-debug.log
npm not ok
root@pool:/var/www/nomp# vi npm-debug.log
root@pool:/var/www/nomp# vi npm-debug.log
root@pool:/var/www/nomp# npm config set registry http://registry.npmjs.org/
root@pool:/var/www/nomp# npm install
npm WARN [email protected] package.json: bugs['name'] should probably be bugs['url']
npm http GET http://registry.npmjs.org/body-parser
npm http GET http://registry.npmjs.org/request
npm http GET http://registry.npmjs.org/bignum
npm http 200 http://registry.npmjs.org/request
npm http GET http://registry.npmjs.org/request/-/request-2.34.0.tgz
npm http 200 http://registry.npmjs.org/request/-/request-2.34.0.tgz
npm http 200 http://registry.npmjs.org/body-parser
npm http GET http://registry.npmjs.org/body-parser/-/body-parser-1.0.2.tgz
npm http 200 http://registry.npmjs.org/bignum
npm http GET http://registry.npmjs.org/bignum/-/bignum-0.6.2.tgz
npm http 200 http://registry.npmjs.org/body-parser/-/body-parser-1.0.2.tgz
npm http 200 http://registry.npmjs.org/bignum/-/bignum-0.6.2.tgz

npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: [email protected]
npm ERR! Required: ["node >= 0.8.0"]
npm ERR! Actual:   {"npm":"1.1.4","node":"0.6.12"}
npm ERR! 
npm ERR! System Linux 3.8.0-29-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/nomp
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}
npm http GET http://registry.npmjs.org/type-is
npm http GET http://registry.npmjs.org/raw-body
npm http GET http://registry.npmjs.org/qs

> [email protected] install /var/www/nomp/node_modules/bignum
> node-gyp configure build

sh: 1: node-gyp: not found
npm ERR! error installing [email protected]
npm http 200 http://registry.npmjs.org/qs
npm http 200 http://registry.npmjs.org/raw-body
npm ERR! error installing [email protected]
npm http GET http://registry.npmjs.org/qs/-/qs-0.6.6.tgz
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/nomp/npm-debug.log
npm not ok

3 Answers 3

2

I also hit into this error. It might be due to my network.

I work out as:

npm --strict-ssl false install <pkg>

This option sets validation on nodejs's CA as optional. I think it has the same effect as Sandile's answer.

Sign up to request clarification or add additional context in comments.

Comments

1

I think an issue just like this one has already been answered to some degree here: NPM installation error.

But, to save you some time, try npm config set registry http://registry.npmjs.org/

3 Comments

I ran that and then did npm install. Edited OP look at what it returned.
you could try sudo npm install -g npm first to make sure you're using the latest version of npm
I get an error: module.js:472 throw err; Error: Cannot find module '../lib/utils/unsupported.js'
1

I was having the same kind of problem with the same version of node and npm.

npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4

These are the versions that you get with ubuntu using apt-get.

To fix the problem, I removed the old versions:

sudo apt-get remove nodejs

This removes node and npm. Then installed the latest:

mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=/usr/local
make
sudo make install
sudo chmod -R a+rx /usr/local/lib/node_modules

You can remove the install directory when you're done with it. I got the script that I based this on from: https://gist.github.com/isaacs/579814 which is linked to from: http://www.joyent.com/blog/installing-node-and-npm/ The article is a little out of date. For instance, npm comes with node now.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.