We are encountering an issue where we want to download packages from JFrog Artifactory instead of the internet. We are able to route the composer root and dependent packages from JFrog Artifactory; however, we are unable to route dependent packages that are coming from https://registry.npmjs.org. Here are the steps we've tried so far:
- Configuring npm remote repo in JFrog: We set the remote URL to https://registry.npmjs.org and referenced it in the composer.json file as follows:
"repositories": [
{"type": "package", "url": "https:<base url>/artifactory/api/npm/npm"}
]
- Configuring JFrog repo as composer type: We set the remote URL to https://registry.npmjs.org and referenced it in the composer.json file as follows:
"repositories": [
{"type": "composer", "url": "https:<base url>/artifactory/api/npm/npm"}
]
Adding the dependent package in composer.json: We defined the dependent package under the repositories tag as described below:-
"repositories": [
{
"type": "package",
"package": {
"name": "popperjs/popperjs",
"type": "drupal-library",
"version": "2.11.6",
"dist": {
"url": https://shekharp.jfrog.io/artifactory/composer-local/core-2.11.6.tgz,
"type": "tar"
}
}
}
]