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

NPM version in subfolder is different

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • nodejs-plugin
    • None

      I am setting up my build environment by using the plugin to install node 16. In my first shell build step, I output `node -v` and `npm -v` and see the following

      22:31:29 + node -v
      22:31:29 v16.20.2
      22:31:29 + npm -v
      22:31:29 8.19.4 

      Looks good.

      But then my gulpfile runs, which looks in multiple sub folders, and if there is a package-lock.json file, it runs the command

      npm --prefix ' + filePath + ' install ' + filePath + '/ --production 

      This works for 99% of my jobs, but for one job recently, something odd has been happening.

      The npm version that is used to run the command turns out to be v6.10.0, which modifies my package-lock.json files to lockfileVersion 1, and lots of packages are not installed.

      What would cause this to happen all of a sudden?

            nfalco Nikolas Falco
            mr_pablo Paul
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: