When using NPM we can put in the package.json file various Git URLs and GitHub URLs as external dependencies. In Artifactory, under "External Dependency Rewrite" in NPM virtual repository we have an option to rewrite all the external dependencies from the package.json file. We fully support all the external dependencies from the NPM documentation except for the dependency in the following format git+ssh://firstname.lastname@example.org:npm/npm#semver:^5.0 - we don't handle all the semver expressions that are valid for NPM. For example, the dependency git+ssh://email@example.com:npm/npm#semver:4.x.0 is valid for NPM but not valid for Artifactory. We would like to support all semver expressions that are supported by NPM (we already support most of them).
see links attached: https://docs.npmjs.com/files/package.json#git-urls-as-dependencies
- create NPM local repository and upload an NPM package with an external dependency in the format mentioned above.
- create NPM virtual repository and in the Advanced tab under "External Dependency Rewrite" set the Enable Dependency Rewrite check box to true. (you also need to create NPM remote repository) and of course point it to your local and remote NPM repositories.
- curl -XGET -uadmin:password http://localhost:8081/artifactory/api/npm/npm-virtual-repo/package-name - this command returns the package.json with your exteranl dependencies rewritten.