Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-14805

The npm repo's package.json file's version field are not being correctly parsed if they have v in front of it

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 4.0.0, 5.2.1, 5.4.6
    • Fix Version/s: 6.2.0
    • Component/s: NPM
    • Labels:
      None

      Description

      Added:

      Per npmjs semver spec, A leading "=" or "v" character is stripped off and ignored.

      A leading = should be hanled as well.

      =======================================================================================================

       

      The NPM package.json file is not being correctly parsed when there is a V(v5.0.14) in the version field of the package.json file. The npm install command fails returning a 404 even when there is a valid package exisiting in the NPM repo of artifactory.

      Below are the steps to recreate the issue,

      1) Create a REMOTE NPM repo in Artifactory.
      Call it npmjs
      2) Create a LOCAL repo in Artifactory
      Call it npmjs-approved
      3) Modify the ~/.npmrc file to contain:
      registry=http://jfrog-artifactory.com:8081/artifactory/api/npm/npmjs
      4) Create a folder ‘jfrog’ & create the package.json file to contain:
      {

      "name": "project-template",

      "version": "1.0.0-SNAPSHOT",

      "description": "Project template",

      "private": true,

      "engines":

      { "node": ">= 5.8.0" }

      ,

      "author": "JFROG, Inc.",

      "dependencies":

      { "highcharts" : "5.0.14" }

      ,

      "devDependencies" : {

      },

      "peerDependencies" : {

      }

      }

      5) Now pull down the artifact ‘highcharts’ by running the command ‘npm install’

      6) Please check that you have the highcharts 5.0.14 artifact in your node_modules directory

      7) Please check that you have the highcharts artifact in your npmjs-cache in Artifactory

      8) In Artifactory, right click on the npmjs-cache and choose copy contents and choose the target repo to be npmjs-approved

      9) In Artifactory, right click on the npmjs-cache and choose delete contents

      10) Change your ~/.npmrc file to contain:
      registry=http://jfrog-artifactory.com:8081/artifactory/api/npm/npmjs-approved

      11) Delete any cached artifacts:
      rm -rf ./node_modules (In the Jfrog Directory)
      npm cache clean
      12) Now try ‘npm install’ again

      If you point the browser to the exact same location where the Artifactory throws 404 and add v in front of the version within the url, the package.json file is present

        Attachments

          Activity

            People

            • Assignee:
              lizad Liza Dashevski (Inactive)
              Reporter:
              manojt Manoj Tuguru
              Assigned QA:
              Konstantin Shenderov
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: