Skip to content

Migrating from npm to pnpm

Published: at 05:33 PM

With my recent migration from Windows to a Linux distro, I decided to make the change from npm to pnpm. There are vast quantities of articles about why pnpm is worth it. This article is more for me to remember how to install and use it.

Fresh OS install

  1. Get node
  2. Install pnpm

Migrating Project

  1. Clone repo
  2. Delete node_modules
  3. (Optional) To prevent use of yarn/npm add "preinstall": "npx only-allow pnpm" to the package.json scripts
  4. Run pnpm import to get the new lock file
  5. Remove packages-lock.json
  6. Install dependencies pnpm install
  7. Test. pnpm dev

Resources