【问题标题】:Why isn't Angular2 part of my replicated npm repository?为什么 Angular2 不是我复制的 npm 存储库的一部分?
【发布时间】:2016-05-30 19:20:48
【问题描述】:

我成功地启动并运行了一个私有 npm 服务器,它驻留在我的 Windows 10 机器上的 Ubuntu VM 中。

我使用 https://skimdb.npmjs.com/registry 作为 CouchDB 的源复制了 npm 存储库,并且可以从我的 Windows 10 机器上查询包,例如 jquery

PS D:\Sources\NodeJS\test> npm view jquery

{ name: 'jquery',
  description: 'JavaScript library for DOM operations',
  'dist-tags': { beta: '3.0.0-rc1', latest: '2.2.4' },
  ...
  gitHead: 'c0185ab7c75aab88762c5aae780b9d83b80eda72',
  dist:
   { shasum: '2c89d6889b5eac522a7eea32c14521559c6cbf02',
     tarball: 'http://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz' },
  directories: {} }

但是,所有 @angular/* 软件包似乎都丢失了。如果我直接将 npm 指向skimdb,我会得到完全相同的结果,所以复制不会有问题。

PS D:\Sources\NodeJS\test> npm view @angular/common
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "view" "@angular/common"
npm ERR! node v5.9.1
npm ERR! npm  v3.7.3
npm ERR! code E404

npm ERR! 404 Not Found: @angular/common
npm ERR! 404
npm ERR! 404  '@angular/common' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Sources\NodeJS\test\npm-debug.log

这是开始的正确注册表吗?

【问题讨论】:

    标签: node.js npm angular


    【解决方案1】:

    好的,这似乎归结为作用域包,其中@angular 是某种命名空间。

    我通过指向 @angular 范围内的软件包的官方存储库解决了这个问题,即我的 .npmrc 现在看起来如下:

    registry=http://<couchdb server ip>:5984/registry/_design/app/_rewrite
    @angular:registry=https://registry.npmjs.org/
    

    【讨论】:

      猜你喜欢
      • 2014-03-02
      • 1970-01-01
      • 2016-10-25
      • 2013-08-05
      • 2023-01-19
      • 2013-12-30
      • 2013-11-11
      相关资源
      最近更新 更多