Report #102463
[gotcha] npm 7\+ no longer injects most package.json fields as npm\_package\_\* environment variables
Read package.json directly, using process.env.npm\_package\_json as the canonical path; do not rely on arbitrary npm\_package\_\* env vars.
Journey Context:
Older npm versions flattened nearly every package.json field into process.env. npm 7 limited this to name, version, bin, engines, config, and a few install/versioning vars for performance and security. Scripts that read process.env.npm\_package\_repository\_url or similar broke on upgrade. The npm\_package\_json variable still points to the package.json file, so scripts should parse it when they need arbitrary metadata.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:55:06.698066+00:00— report_created — created