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

Possible regression, publishing npm package fails on 3.5.2, same package works on 3.1.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.2
    • Fix Version/s: 3.6.1
    • Component/s: NPM
    • Labels:
    • Story Points:
      1

      Description

      Paypal is getting an error when publishing the attached npm package into Nexus 3.5.2.The same package can be published into Nexus 3.1.0 without any problem.

       

      2017-09-18 15:01:57,161-0300 WARN [qtp1859861179-243] admin org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: PUT /repository/npm-hosted/nemo-appscan-plugin
      java.lang.IllegalStateException: Unexpected token VALUE_NULL at [Source: java.io.InputStreamReader@1afd130f; line: 1, column: 192]
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:150)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseObject(NpmPublishParser.java:174)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:136)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseArray(NpmPublishParser.java:189)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:138)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseArray(NpmPublishParser.java:189)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:138)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseObject(NpmPublishParser.java:174)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:136)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseObject(NpmPublishParser.java:174)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:136)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parsePackageRoot(NpmPublishParser.java:123)
      at com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parse(NpmPublishParser.java:98)
      at com.sonatype.nexus.repository.npm.internal.NpmRequestParser.parseNpmPublish(NpmRequestParser.java:81)
      at com.sonatype.nexus.repository.npm.internal.NpmRequestParser.parsePublish(NpmRequestParser.java:60)
      at com.sonatype.nexus.repository.npm.internal.NpmHostedFacetImpl.putPackage(NpmHostedFacetImpl.java:85)
      at com.sonatype.nexus.repository.npm.internal.NpmHandlers$3.handle(NpmHandlers.java:172)
      at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
      

      This is caused by the "scope": "null" line here:

      "_args": [
          [
            {
              "raw": "nemo-appscan-plugin@0.0.10",
              "scope": null,
              "escapedName": "nemo-appscan-plugin",
              "name": "nemo-appscan-plugin",
              "rawSpec": "0.0.10",
              "spec": "0.0.10",
              "type": "version"
            },
            "C:\\Users\\xxx\\Desktop\\test"
          ]
        ],
      

      The "_args" is added by the npm installer when it locally installs a package in a node_modules directory:

      https://github.com/npm/npm/issues/10393

      And it seems like it was only put in when using npm versions prior to 5, although I'm not completely certain about that.

      I'm not sure about whether publishing the package.json produced by a local install is a good idea or not, but we should at least be able to handle these uploads, especially because we used to do that in version 3.1.0. (We may want to be ignoring these fields being put in by the npm install altogether, but this particular issue is related to a parsing regression.)

        Attachments

          Activity

            People

            Assignee:
            jstephens Joseph Stephens
            Reporter:
            rseddon Rich Seddon
            Last Updated By:
            Peter Lynch
            Team:
            Nexus - Formats
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title