-
Resolve a range to a version
Only when the lockfile has no usable entry. min-release-age acts here, so it never re-checks versions already locked.
npm 11.x+: cooldown -
Read the lockfile entry
"node_modules/ms": version 2.1.3, resolved URL, integrity hash. Written by the last npm install, or by whoever edited the pull request.
-
Fetch the resolved URL
npm 12 rejects hosts other than the configured registry with EALLOWREMOTE. npm 11 fetches any host.
npm 12: allow-remote checks host -
Hash the bytes
SHA-512 of the tarball must equal integrity, or npm stops with EINTEGRITY. If the field is missing, nothing is checked.
all versions: integrity checks bytes -
Extract into node_modules/ms
The tarball's own package.json may say left-pad 1.3.0. npm does not compare it with the key or the version label.
never checked: name and version -
Decide on install scripts
npm 12 matches allowScripts against the extracted package.json, so approving ms@2.1.3 did not approve the swapped package's script.
npm 12: scripts off by default -
Record and report
npm copies the lockfile's labels into node_modules/.package-lock.json. npm ls reads that file and prints ms@2.1.3, exit code 0.
npm ci, tested on npm 11.21.1 and 12.2.1. Four controls check release age, the host, the bytes, and the scripts. None checks that the bytes are the package the lockfile names.