-
-
Notifications
You must be signed in to change notification settings - Fork 235
Description
When using Homebrew to install Node.js, enabling Corepack, and then using Corepack to manage pnpm, Corepack does not add a packageManager field to my package.json. This field should be automatically added, but it is missing, requiring me to add it manually.
Setting the COREPACK_ENABLE_AUTO_PIN=1 in zshrc does not resolve the issue. Even after reinstalling Corepack and Node.js, the problem still exists.
Steps to Reproduce:
brew install node@20brew link --overwrite node@20corepack enablecorepack prepare pnpm@latest --activatepnpm setupmkdir testcd testpnpm initcorepack use pnpm@latestorpnpm install
Expected Behavior
Corepack should automatically add the packageManager field to package.json when using pnpm.
Actual Behavior
The packageManager field is not added, and setting COREPACK_ENABLE_AUTO_PIN=1 in ~/.zshrc does not fix the issue. Reinstalling Corepack and Node.js does not resolve the problem either.
Additional Information
Node.js v20.17.0
Corepack 0.29.3
pnpm 9.10.0
How can I set the environment variable to enable this functionality, and are there any other steps to resolve this issue?