最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Pnpm package manager downgrade - Stack Overflow

programmeradmin3浏览0评论

What is the proper way of downgrading pnpm to an older version? I have currently the latest version 7+, while I need version 6.32. npm has a nice tools for it: volta or nvm, but haven't found anything for pnpm if it's intalled globally.

What is the proper way of downgrading pnpm to an older version? I have currently the latest version 7+, while I need version 6.32. npm has a nice tools for it: volta or nvm, but haven't found anything for pnpm if it's intalled globally.

Share Improve this question asked Jun 6, 2022 at 11:14 AlexAlex 1,4204 gold badges22 silver badges39 bronze badges
Add a comment  | 

5 Answers 5

Reset to default 9

On Windows in a bash terminal, I was able to downgrade from version 9.1.4 to 8.15.7 by executing: pnpm add -g [email protected]

Since v16.13, Node.js is shipping Corepack for managing package managers.

https://pnpm.io/installation#using-corepack

corepack prepare [email protected] --activate

Use this command to just change the pnpm version.

All version Tags can be found on pnpms github page: https://github.com/pnpm/pnpm/tags?after=v6.32.2

As indicated on this page https://pnpm.io/fr/uninstall you must delete the directory stored in the $PNPM_HOME environment variable. So type:

$PNPM_HOME

Then delete it with the following command on linux or macOs:

sudo rm -rf $PNPM_HOME

Or by deleting the folder directly with windows

As an alternative, if you just need to use another version of pnpm for a particular project, just switch to another version of node with nvm, since each version has its own global packages. That way you can have pnpm 8 for node 18 and pnpm 7 for node 16

If you have installed pnpm through Node.js corepack:

// enable corepack
corepack enable
// switch pnpm 6.32 version
corepack prepare [email protected] --activate
// switch pnpm latest version
corepack prepare pnpm@latest --activate
发布评论

评论列表(0)

  1. 暂无评论