Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70078

npm config is not compatible with npm version 9+

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • nodejs-plugin
    • None
    • 1.6.0

      Private registries with authentication require a special configuration since npm version 9.

      In npm version 6 the npmrc looks like this:

      registry = https://some.private.registry/api/npm/my-npm-repo/
      _auth = 3489034someHashwfhdsd87
      

      In npm version 9, the key _auth must be mapped to a specific registry:

      registry = https://some.private.registry/api/npm/my-npm-repo/
      //some.private.registry/api/npm/my-npm-repo/:_auth = 3489034someHashwfhdsd87
      

      npm version 8 is still compatible with the old configuration format, but a warning appears in the logs:

      npm WARN config `_auth`, `_authToken`, `username` and `_password` must be scoped to a registry. see `npm help npmrc` for more information.
      

      The nodejs-plugin currently lacks support for the new configuration format.

          [JENKINS-70078] npm config is not compatible with npm version 9+

          Nikolas Falco added a comment -

          .npmrc file is created with a provider as extension of config-files-provider that at runtime does not have the npm version under the hood.

          I need to find a way to differentiate config file or an option inside of it.

          Nikolas Falco added a comment - .npmrc file is created with a provider as extension of config-files-provider that at runtime does not have the npm version under the hood. I need to find a way to differentiate config file or an option inside of it.

          Nikolas Falco added a comment -

          When create/edit a NPMConfig file an option enable or not credentials attribute in format compatible with npm 9+

          Nikolas Falco added a comment - When create/edit a NPMConfig file an option enable or not credentials attribute in format compatible with npm 9+

            nfalco Nikolas Falco
            shoelzle Stefan Hölzle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: