I\'m new to Node.js, and I\'m going through a few tutorials. For some reason, I can\'t install any new node modules.
I am using:
Mac OSX 10.7.4,
The repository is not down, it looks like they've changed how they host files (I guess they have restored some old code):
Now you have to add the /package-name/ before the -
Eg:
http://registry.npmjs.org/-/npm-1.1.48.tgz
http://registry.npmjs.org/npm/-/npm-1.1.48.tgz
There are 3 ways to solve it:
Use a public proxy:
--registry http://165.225.128.50:8000
Host a local proxy:
https://github.com/hughsk/npm-quickfix
git clone https://github.com/hughsk/npm-quickfix.git cd npm-quickfix npm set registry http://localhost:8080/ node index.js
I'd personally go with number 3 and revert to npm set registry http://registry.npmjs.org/
as soon as this get resolved.
Stay tuned here for more info: https://github.com/isaacs/npm/issues/2694
This error might also occur due to proxy settings, once check that your proxy allow the access to npm commands.
It worked for me quite well.
If you happened to run npm install
command on Windows, first make sure you open your command prompt with Administration Privileges. That's what solved the issue for me.
npm set registry http://85.10.209.91/
(this proxy fetches the original data from registry.npmjs.org and manipulates the tarball urls to fix the tarball file structure issue).
The other solutions seem to have outdated versions.
Npm repository is currently down. See issue #2694 on npm github
EDIT:
To use a mirror in the meanwhile:
npm set registry http://ec2-46-137-149-160.eu-west-1.compute.amazonaws.com
you can reset this later with:
npm set registry https://registry.npmjs.org/
source
I found the there is a certificate expired issue with:
npm set registry https://registry.npmjs.org/
So I made it http, not https :-
npm set registry http://registry.npmjs.org/
And have no problems so far.