-
Notifications
You must be signed in to change notification settings - Fork 577
Description
Corepack is an official Node.js tool for managing package managers like npm, pnpm, or Yarn.
It has been bundled with Node.js versions since v16.9.
Instead of running npm i -g yarn
, you run corepack enable
. This places yarn
+ pnpm
binaries (technically they're Corepack shims) alongside the node
binary.
Unfortunately, switching to a new Node.js version with fnm requires you to run corepack enable
again before you can use your custom package managers.
Could a configuration option (ex. --corepack
) be added to automatically handle this for users?
Related: post-install hooks like in #139 could be used to run corepack enable
, although it might be good to have a dedicated option for Corepack since it's going to be a very common workflow for Node.js users