Per*_*ley 2 node.js npm angularjs docker
我们公司为我们的包建立了一个私有的 npm 注册中心。我们正在尝试设置一个 angular2 应用程序,并且包含的所有 angular 包(来自 angular2 教程页面)都是有作用域的。问题是当 npm 设置为我们的私有注册表时,它npm install给了我们以下错误消息:
npm ERR! Linux 4.4.8-boot2docker
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v4.3.0
npm ERR! npm v2.14.12
npm ERR! code E404
npm ERR! 404 no such package available : @angular/core
npm ERR! 404
npm ERR! 404 '@angular/core' 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 It was specified as a dependency of 'search-ui'
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! /tmp/npm-debug.log
Run Code Online (Sandbox Code Playgroud)
如果我将它设置为默认的 npm 注册表,angular2 可以正常拉取,但在尝试下载私有包时显然会失败。
我还没有确定这是一个整体的 angular2 事情(包管理器中的一些权限)还是只是所有范围的包(不确定其他范围的包存在)。但是,我尝试了各种方法来安装全套软件包,但无济于事(例如使用 git repo 而不是仅在不可接受的特定情况下工作的软件包版本)。当我尝试将其部署到 Docker 容器或在本地运行(主要关注容器情况)时,就会出现此错误。
有没有其他人遇到过这个问题?如果这有点模糊,我也很抱歉,所以如果需要更多信息,请随时发表评论。
小智 5
正如 NPM在文档中所说,所有私有包都是有作用域的,并且作用域可以与自定义注册表相关联。
因此,如果您的私有包是@myPrivateScope/aPrivatePackage,则可以通过将以下行添加到项目根目录上的.npmrc文件来解决您的问题:
@myPrivateScope:registry=http://my.private.registry.com
Run Code Online (Sandbox Code Playgroud)
等号后面的 url 是您的私有注册表的地址。
您可以在https://docs.npmjs.com/misc/scope#associating-a-scope-with-a-registry上找到其他方法来进行此关联以及有关它的更多信息
| 归档时间: |
|
| 查看次数: |
4163 次 |
| 最近记录: |