Lets say I have a private npm repository, hosted within JFrog artifactory:
https://my-domain.com/artifactory/api/npm/my-repo
.
In this repository I published one npm package: my-package
, which builds fine. my-package
has a dependency (or more) to public npm packages e.g. lodash
.
However, when I create a new project and attempt to install my-package
I get the following error:
$ 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
It appears as though npm
is searching within my private repository for all the dependencies my-package
requires when I specify the --registry
option when running an npm install
. However, my-package
is dependent upon public dependencies, which are not in my private registry.
My Question
How to install an npm package from a private registry that has public dependencies? Perhaps this is also just a JFrog issue?
Any help would be greatly appreciated!