Skip to content

docs: note that npm install -g does not create a local node_modules - #10109

Open
ump45nose wants to merge 1 commit into
npm:latestfrom
ump45nose:contrib-fix-2968
Open

ump45nose wants to merge 1 commit into
npm:latestfrom
ump45nose:contrib-fix-2968

Conversation

@ump45nose

Copy link
Copy Markdown

Adds a note to npm install's global-mode description: npm install -g in a package directory installs the current package context globally and does not create a local node_modules in that directory, so if the package should also work locally, run a plain npm install there.

Status / please decide: #2968 is labeled Needs Discussion and reports this as a bug in v7. This PR only documents the current behavior described in the issue; it does not change install behavior, and if the team decides the behavior should change, this note should not be merged. Refs #2968.

No tests run (docs only).

AI assistance disclosure: this change was prepared with the help of an AI coding agent (Grok Bot). The account owner has not reviewed every line in detail; please treat it accordingly.

The `npm install` docs described global mode as installing "the current
package context ... as a global package" without saying whether the
package's own dependencies are installed locally. Users migrating from
npm 6 reported `UNMET DEPENDENCY` after `npm install -g`, because since
npm 7 no `node_modules` is created in the current directory.

Add a note spelling out that global mode installs the package context
itself and that a separate `npm install` is still needed for the local
dependencies.

Closes: npm#2968
@ump45nose
ump45nose requested a review from a team as a code owner October 10, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant