npm / npm/cli

[BUG] npm_package_from not set in lifecycle

Open
#2,811 5 comments 0 reactions 1 assignee View on GitHub

@isaacs is already working on this.

Since Apr 16, 2021.

Bug Release 7.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

https://github.com/npm/rfcs/blob/d2f8dc3cbf35217a31d1bb5491154b18d4fb2276/implemented/0021-reduce-lifecycle-script-environment.md

the rfc that got rid of most of the environment variables states there will be an npm_package_from variable in when a package is being installed. there isn't. npm_package_resolved, and npm_package_integrity are there.

npm_package_from is not.

current behaviour

npm_package_from not set in install lifecycle hook

expected behaviour

npm_package_from would be set in install lifecycle hook

steps

  • npm install @chee/yeet 2>&1 | grep npm_package
  • look at the output, and note there is no npm_package_from
    the install script of that package is env && false

Environment:

  • os: arch linux version 200 and something
  • node: 15.10.0
  • npm: 7.6.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.