【发布时间】:2019-04-29 13:13:18
【问题描述】:
假设我有一个私有 npm 存储库,托管在 JFrog artifactory 中:
https://my-domain.com/artifactory/api/npm/my-repo。
在这个存储库中,我发布了一个 npm 包:my-package,构建良好。 my-package 对公共 npm packages 有依赖(或更多),例如lodash.
但是,当我创建一个新项目并尝试安装 my-package 时,我收到以下错误:
$ npm install my-package --registry https://my-domain.com/artifactory/api/npm/my-repo
npm ERR! code E404
npm ERR! 404 Not Found - GET https://my-domain.com/artifactory/api/npm/my-repo/lodash - not_found
npm ERR! 404
npm ERR! 404 'lodash^4.17.11' 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 'my-package'
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! A complete log of this run can be found in:
npm ERR! C:\Users\<username>\AppData\Roaming\npm-cache\_logs\2019-04-29T12_47_51_647Z-debug.log
当我在运行npm install 时指定--registry 选项时,似乎npm 正在我的私有存储库中搜索my-package 所需的所有依赖项。但是,my-package 依赖于公共依赖项,这些依赖项不在我的私有注册表中。
我的问题
如何从具有公共依赖项的私有注册表安装 npm 包?也许这也只是 JFrog 的问题?
任何帮助将不胜感激!
【问题讨论】:
标签: npm npm-install npm-registry