documentation
documentation copied to clipboard
Scripts documentation incorrectly states all package.json fields are provided via the environment
According to the scripts documentation, all of the fields in package.json are exposed to scripts via environment variables. However, this isn't true: they were removed in 2021 in npm 7 without replacement. I eventually had to track down the 7.0.0-rc0 changelog to find out what changed and the motivation; it would be great if the docs accurately reflected the current state of what's available for scripts.
There are a few issues about this in the npm repo, a couple of which are still open and mention that the docs are out of date: https://github.com/npm/cli/issues/3022 https://github.com/npm/cli/issues/2452