DEV Community

Discussion on: How to migrate from yarn / npm to pnpm

Collapse
 
buzzdee profile image
Sebastian Schlatow

If I use npm ci in a Jenkins / GitLab pipeline, what command do I need to use with pnpm?

Collapse
 
andreychernykh profile image
Andrei Chernykh

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

Here is a good answer on StackOverflow stackoverflow.com/questions/701545...