Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-19709

Scoped npm packages do not work with Nexus

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 3.15.2, 3.16.0
    • Fix Version/s: None
    • Component/s: NPM
    • Labels:
      None
    • Environment:
      Sonatype Nexus Repository Manager OSS 3.16.0-01
      Linux server running Nexus. MacOS client running yarn/npm commands.

      Description

      I have set up a NPM proxy repository that proxies https://registry.npmjs.org

      It seems that scoped packages e.g @sentry/browser are not working. All the non scoped packages are working.

       

      For example:

      My package.json has dependency 

      "@sentry/browser": "4.4.1",

      I have set up .yarnrc to connect my repository. When running for example 

      yarn outdated --verbose
      verbose 1.015 Request "https://my-repo/repository/npm-group/@sentry%2fbrowser" finished with status code 404.
      
      verbose 1.028 Error: couldn't find @sentry/browser
      
          at NpmRegistry.<anonymous> (/usr/local/Cellar/yarn/1.15.2/libexec/lib/cli.js:31666:15)
      
          at Generator.next (<anonymous>)
      
          at step (/usr/local/Cellar/yarn/1.15.2/libexec/lib/cli.js:304:30)
      
          at /usr/local/Cellar/yarn/1.15.2/libexec/lib/cli.js:315:13
      
          at process._tickCallback (internal/process/next_tick.js:68:7)
      
      error An unexpected error occurred: "couldn't find @sentry/browser".
      
      info If you think this is a bug, please open a bug report with the information provided in "/Users/somepath/yarn-error.log".
      
      info Visit https://yarnpkg.com/en/docs/cli/outdated for documentation about this command.

      yarn is trying to fetch this request https://my-repo/repository/npm-group/@sentry%2fbrowser  where Nexus responds with 404. npm will make identical query and gets 404 also from the Nexus. Here the / in package name is URL encoded

      It seems that Nexus expects the URL to be https://my-repo/repository/npm-group/@sentry/browser. At least this will not return 404. Here the / in the package name is NOT URL encoded.

      Yarn outdated is just an example. It seems that there is same behavior whenever yarn actually tries to fetch the package data from the Nexus repository.

      This happens at least with Nexus OSS 3.16.0-01and 3.15.2-01

       

       

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jsyrjala Juha Syrjälä
            Last Updated By:
            Peter Lynch Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title