假设我有一个私有 npm 存储库,托管在JFrog artifactory中:
https://my-domain.com/artifactory/api/npm/my-repo
。在这个存储库中,我发布了一个 npm package: my-package
,它构建得很好。my-package
对公共 npm包有依赖(或更多),例如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
运行. 但是,依赖于公共依赖项,这些依赖项不在我的私人注册表中。my-package
--registry
npm install
my-package
我的问题
如何从具有公共依赖项的私有注册表安装 npm 包?也许这也只是一个 JFrog 问题?
任何帮助将不胜感激!