javascript - 如何使用 NPM 镜像

标签 javascript node.js npm

npm 注册表再次关闭,导致 npm install 无法正常工作。

问题:我们如何使用npm从npm镜像拉取包?有推荐的 npm 镜像吗?

最佳答案

使用npm镜像

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

您可以稍后使用 npm set registry 重置它

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

然后正常使用:

npm install express

你也可以看到这个gist有关上述解决方案的更多信息。

关于javascript - 如何使用 NPM 镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19967376/

相关文章:

javascript - 使用javascript代码用鼠标滚轮垂直滚动div

javascript - 除非调用 onclick,否则脚本不会运行

node.js - setTimeout 在 Linux 上精确但在 Windows 上不精确?

javascript - 可以在 NodeJS/Javascript 中使用 while/for 循环将此递归代码编写为迭代代码吗

node.js - 如何连接solr和nodejs?

sqlite - NodeJS + AppJS + Sqlite3

meteor 中的 mysql npm 模块

javascript - 使用 HTML/javascript 在没有 gps 的情况下获取经纬度

node.js - 你如何阅读 npm audit ERESOLVE 错误?

javascript - 如何为其他用户远程启用/禁用 tampermonkey 脚本