Skip to content

Scripts documentation incorrectly states all package.json fields are provided via the environment #1178

@mistydemeo

Description

@mistydemeo

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:
npm/cli#3022
npm/cli#2452

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions