I'm not 100% sure, but according to the docs (docs.npmjs.com/cli/v8/commands/npm-ci) one of the main features of npm ci is If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.
pnpm docs says In a CI environment, installation fails if a lockfile is present but needs an update. pnpm.io/cli/install
So, it looks like pnpm i behaves similar to npm ci. Try just pnpm i or pnpm install --frozen-lockfile
If I use
npm ciin a Jenkins / GitLab pipeline, what command do I need to use withpnpm?I'm not 100% sure, but according to the docs (docs.npmjs.com/cli/v8/commands/npm-ci) one of the main features of
npm ciisIf dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.pnpmdocs saysIn a CI environment, installation fails if a lockfile is present but needs an update.pnpm.io/cli/install
So, it looks like
pnpm ibehaves similar tonpm ci. Try justpnpm iorpnpm install --frozen-lockfileHere is a good answer on StackOverflow stackoverflow.com/questions/701545...