【问题标题】:How to use an NPM Mirror如何使用 NPM 镜像
【发布时间】:2013-11-14 14:40:03
【问题描述】:

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

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

【问题讨论】:

    标签: javascript node.js npm


    【解决方案1】:

    使用 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 了解有关上述解决方案的更多信息。

    【讨论】:

    • 我们怎么知道这个注册表没有被入侵?
    【解决方案2】:

    Here is a Gist with what seems to be complete instructions for setting up a mirror, with a demo mirror/example.。不确定该人的镜像是否仍在运行,但提供的示例似乎很简单:

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

    【讨论】:

      猜你喜欢
      • 2012-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-16
      • 1970-01-01
      • 2017-09-29
      • 1970-01-01
      相关资源
      最近更新 更多