Search code examples
node.jswordpresswoocommercepnpm

How to install old version of pnpm in ubuntu


I need to install the old version of pnpm v6.24.2 for woocommerce-admin current version is 7.9.0 also getting errors while running npm build:

Your pnpm version is incompatible with "/home/user/Desktop/woocommerce-admin".

Expected version: ^6.24.2
Got: 7.9.0

This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.

Solution

  • You can run:

    pnpm install --global pnpm@latest-6
    

    Alternatively, if you use Corepack, you may add this to your package.json:

    {
      "packageManager": "pnpm@6.34.0"
    }
    

    Corepack automatically manages pnpm versions, so if you will run pnpm inside that project, Corepack will install and run the right version of pnpm.