0

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:

  1. 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"}
]
  1. 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"
            }
        }
    }
]
6
  • It doesn't feel like this is going to need any knowledge of Drupal to answer, it's probably better asked on Stack Overflow. When you post it over there, make sure you add the information from your own debugging, and describe what you mean by we are unable to route dependent packages, as it's currently not clear what problem you're actually reporting (does it fail with an error, does it complete without errors but not do insert what you expect it to do here, etc.)
    – Clive
    Commented Sep 18 at 15:38
  • This question is similar to: Managing module library dependencies with composer. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
    – mona lisa
    Commented Sep 18 at 15:47
  • Actually rather this is a duplicate of drupal.stackexchange.com/questions/262203/….
    – mona lisa
    Commented Sep 18 at 15:54
  • The question is about how to install NPM packages into a Drupal site with Composer. That is answered in drupal.stackexchange.com/questions/262203/…
    – mona lisa
    Commented Sep 18 at 15:59
  • @monalisa this is different to the linked question, it’s specifically asking how to do it without using the standard npm-asset repo
    – Clive
    Commented Sep 18 at 16:03

1 Answer 1

0

You should not include the package that way. Instead you should include it with Asset Packagist. This way you should also get the deps of that package.

Alternatively get the deps in manually the same way as you do it now. You need to create library definitions for all of them anyways. (And then add them as dependency to your Frogger library definition.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.