Skip to content

fix: npm ci command fails

Sid Stenersen requested to merge slb/ss/npm-ci into master

Fixed: npm ci command fails

@dsouzawalter described it like this:

Hi @varunmanohar @DiegoMolteni IBM integration test job is failing as npm ci is failing with following error:

_npm ERR! npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing. npm ERR! npm ERR! Invalid: lock file's debug@3.2.6 does not satisfy debug@4.3.4 npm ERR! Missing: debug@3.2.7 from lock file npm ERR! Missing: debug@3.2.7 from lock file npm ERR! Missing: debug@3.2.7 from lock file npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/logs/2022-04-26T23_04_42_571Z-debug-0.log ./tests/e2e/run_e2e_tests.sh: line 176: ./node_modules/newman/bin/newman.js: No such file or directory

Same error can be observed for Azure test job. I'm commenting on this MR as I noticed the error after this MR was merged.

This SO answer mentions that npm ci requires package-lock.json for it to work. https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwie4ZLFkLH3AhVvplYBHfQPAZQQrAIoAHoECAIQAQ&url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F47480617%2Fnpm-how-to-actually-use-package-lock-json-for-installing-based-on-locked-versi&usg=AOvVaw1sF5zQM11Yx8qpeZedAlh_

FYI @anujgupta Thanks.

Edited by Sid Stenersen

Merge request reports