最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to use an NPM Mirror - Stack Overflow

programmeradmin4浏览0评论

The npm registry is down again, resulting in npm install not working.

Question: How do we use npm to pull packages from npm mirrors? Are there any recommended npm mirrors?

The npm registry is down again, resulting in npm install not working.

Question: How do we use npm to pull packages from npm mirrors? Are there any recommended npm mirrors?

Share Improve this question asked Nov 14, 2013 at 0:40 NyxynyxNyxynyx 63.6k163 gold badges505 silver badges855 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 13

use the npm mirror

npm set registry http://ec2-46-137-149-160.eu-west-1.compute.amazonaws.com

you can reset this later with npm set registry

npm set registry https://registry.npmjs.org/

then use it normally:

npm install express

You can also see this gist for more information on the above solution.

Here is a Gist with what seems to be complete instructions for setting up a mirror, with a demo mirror/example.. Not sure if that person's mirror is still running, but the example provided seems simple enough:

$ npm set registry http://domain.of.your.npm.mirror.com

As the question passed almost ten years, I will recommand you to use pnpm in 2023, set the mirror registry like this:

pnpm set registry https://registry.npmmirror.com/
发布评论

评论列表(0)

  1. 暂无评论