packageManager field is automatically created when I use any npm packages. #5085
Replies: 2 comments 3 replies
|
This field is created by corepack, a tool included with node for the time being. Run |
|
It is safe to remove the field, but there is a reproducibility tradeoff worth making explicit.
For Corepack specifically, the field is written deliberately by printf "%s\n" "$COREPACK_ENABLE_AUTO_PIN"If you remove the field but auto-pin remains enabled, it can return on a later package-manager invocation. Also check editor/dev-container/CI setup and the package-manager command itself, since Corepack is not the only possible writer. I would choose one of these policies:
One current-version detail: Corepack was bundled with Node from 14.19 up to, but not including, Node 25. On newer Node versions it must be installed separately, so disabling the bundled copy is not a future-proof explanation by itself. Corepack behavior and auto-pin documentation: https://github.com/nodejs/corepack#environment-variables |

This field is created by corepack, a tool included with node for the time being. Run
corepack disableif you don't want to use it, and if you're using nvm, update to the latest version.