[Tools] Use pnpm as a Node.js version manager

Let's say for the laptop, default node version is 20.17.0, if you want the project to use 20.18.0with pnpm, you can do

// use node 20.18.0
pnpm env use -g 20.18.0

 

or, create a .npmrcfile

use-node-version=23.0.0

When run pnpm start, it will automatically pick up the node version, if you haven't install it yet, pnpm will help to fetch and install the node version

posted @ 2024-10-28 15:28  Zhentiw  阅读(8)  评论(0编辑  收藏  举报