npm / npm/cli

[BUG] `install --no-save` does not install anything

Open
#9,024 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

Attempting to call install --no-save <package> will have no result in npm@^11. This issue does not exist in npm@^10.

Expected Behavior

Calling install --no-save <package> should download the package and place it in the node_modules folder but leave both package.json and package-lock.json unchanged.

Steps To Reproduce
  1. Make sure you use npm@^11
  2. In a NPM project, install any package by calling npm i --no-save <package>
  3. There should be not associated directory in the node_modules folder.
  4. NPM should return up to date instead of added X packages.
Environment

This problem occured on my local machine as well as on our pipeline using node:24 Docker container.

  • npm: 11.10.1
  • Node.js: 24.13.0
  • OS Name: macOS Tahoe 26.2
  • System Model Name: Macbook Pro 14" Nov. 2024 (Apple Silicon M4 Pro)
  • npm config:
; "default" config from default values

_auth = (protected)
access = null
all = false
allow-git = "all"
allow-same-version = false
also = null
audit = true
audit-level = null
auth-type = "web"
before = null
bin-links = true
browser = null
bypass-2fa = false
ca = null
cache = "$HOME/.npm"
cache-max = null
cache-min = 0
cafile = null
call = ""
cert = null
cidr = null
color = true
commit-hooks = true
cpu = null
depth = null
description = true
dev = false
diff = []
diff-dst-prefix = "b/"
diff-ignore-all-space = false
diff-name-only = false
diff-no-prefix = false
diff-src-prefix = "a/"
diff-text = false
diff-unified = 3
dry-run = false
editor = "vi"
engine-strict = false
expect-result-count = null
expect-results = null
expires = null
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
fetch-timeout = 300000
force = false
foreground-scripts = false
format-package-lock = true
fund = true
git = "git"
git-tag-version = true
global = false
global-style = false
globalconfig = "$HOME/.nvm/versions/node/v24.13.0/etc/npmrc"
heading = "npm"
https-proxy = null
if-present = false
ignore-scripts = false
include = []
include-staged = false
include-workspace-root = false
init-author-email = ""
init-author-name = ""
init-author-url = ""
init-license = "ISC"
init-module = "$HOME/.npm-init.js"
init-private = false
init-type = "commonjs"
init-version = "1.0.0"
init.author.email = ""
init.author.name = ""
init.author.url = ""
init.license = "ISC"
init.module = "$HOME/.npm-init.js"
init.version = "1.0.0"
install-links = false
install-strategy = "hoisted"
json = false
key = null
legacy-bundling = false
legacy-peer-deps = false
libc = null
link = false
local-address = null
location = "user"
lockfile-version = null
loglevel = "notice"
logs-dir = null
logs-max = 10
; long = false ; overridden by cli
maxsockets = 15
message = "%s"
min-release-age = null
name = null
node-gyp = "$HOME/.nvm/versions/node/v24.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
node-options = null
noproxy = [""]
npm-version = "11.10.1"
offline = false
omit = []
omit-lockfile-registry-resolved = false
only = null
optional = null
orgs = null
orgs-permission = null
os = null
otp = null
pack-destination = "."
package = []
package-lock = true
package-lock-only = false
packages = []
packages-all = false
packages-and-scopes-permission = null
parseable = false
password = (protected)
prefer-dedupe = false
prefer-offline = false
prefer-online = false
prefix = "$HOME/.nvm/versions/node/v24.13.0"
preid = ""
production = null
progress = true
provenance = false
provenance-file = null
proxy = null
read-only = false
rebuild-bundle = true
registry = "https://registry.npmjs.org/"
replace-registry-host = "npmjs"
save = true
save-bundle = false
save-dev = false
save-exact = false
save-optional = false
save-peer = false
save-prefix = "^"
save-prod = false
sbom-format = null
sbom-type = "library"
scope = ""
scopes = null
script-shell = null
searchexclude = ""
searchlimit = 20
searchopts = ""
searchstaleness = 900
shell = "/bin/zsh"
shrinkwrap = true
sign-git-commit = false
sign-git-tag = false
strict-peer-deps = false
strict-ssl = true
tag = "latest"
tag-version-prefix = "v"
timing = false
token-description = null
umask = 0
unicode = true
update-notifier = true
usage = false
user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}"
userconfig = "$HOME/.npmrc"
version = false
versions = false
viewer = "man"
which = null
workspace = []
workspaces = null
workspaces-update = true
yes = null

; "user" config from $HOME/.npmrc

<private-registry> = "<anonymized>"
<private-registry>/:_authToken = (protected)

; "cli" config from command line options

long = true

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.

Research direction

Start by reproducing npm i --no-save <package> with npm 11.10.1 in a Node.js project, then compare the behavior with npm 10 and trace the CLI install handling. Done means the package appears in node_modules while both package.json and package-lock.json remain unchanged, with the command reporting the installation rather than up to date.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.