[RTFACT-14806] NPM rewrite external dependencies does not support all semver expressions Created: 17/Aug/17  Updated: 12/Jan/20  Resolved: 06/Jan/20

Status: Resolved
Project: Artifactory Binary Repository
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0, 6.17.0

Type: Improvement Priority: Normal
Reporter: Inbar Tal Assignee: Rotem Kfir
Resolution: Fixed Votes: 4
Labels: QF, QF-P2, UGA, artifactory

Issue Links:
relates to RTFACT-18626 NPM dependency rewrites does not acco... Resolved
Assigned QA: Bar Haim
Sprint: Pam - Quality 7


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://git@github.com:npm/npm#semver:^5.0 - we don't handle all the semver expressions that are valid for NPM. For example, the dependency git+ssh://git@github.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

To Reproduce:

  • 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.

Generated at Sat Apr 04 12:59:33 UTC 2020 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.