You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] npm ci fails with newer versions of npm #8767
I haven't been able to install 11.6.3, but 11.6.2, when running npm ci on an extremely simple package.json (and generating a branch new package-lock.json) it fails with:
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Missing: nopt@8.1.0 from lock file
npm error Missing: nopt@8.1.0 from lock file
npm error Missing: @npmcli/installed-package-contents@3.0.0 from lock file
npm error Missing: abbrev@3.0.1 from lock file
npm error Missing: abbrev@3.0.1 from lock file
npm error Missing: npm-bundled@4.0.0 from lock file
npm error Missing: npm-normalize-package-bin@4.0.0 from lock file
Expected Behavior
npm ci should install the packages that are listed in the package.json and package-lock.json
Steps To Reproduce
Create a simple package.json, run npm install, then run npm ci.
Environment
npm: 11.6.2
Node.js: 24.11.1
OS Name: Amazon Linux 2023/Debian
System Model Name: Mac OSX
npm config:
; "project" config from /workspaces/knowbot/.npmrc
@r3c-engineering:registry = "[https://npm.pkg.github.com/"](https://npm.pkg.github.com/%22)
//npm.pkg.github.com/:_authToken = (protected)
registry = "[https://registry.npmjs.org/"](https://registry.npmjs.org/%22)
; node bin location = /home/devuser/.nvm/versions/node/v24.11.1/bin/node; node version = v24.11.1; npm local prefix = /workspaces/knowbot; npm version = 11.6.2; cwd = /workspaces/knowbot; HOME = /home/devuser; Run `npm config ls -l` to show all defaults.
We had this problem as well. We are using @semantic-release/npm in our devDependencies, which in turn uses npm@^11.6.2 as dependency.
As long as npm@11.6.2 was in the lock-file, everything was fine, but npm@11. 6.3 now uses nopt@9 instead of nopt@8.1.0.
I don't know exactly what's going wrong here, but fix could fix the problem by adding this to our package.json:
According to the updated semantic-release documentation, it’s now recommended not to install semantic-release locally at all. Since it’s a release-time dependency rather than a development dependency, they suggest installing it globally in the CI environment or using npx during the release step.
After removing the local devDependencies npm uninstall semantic-release @semantic-release/git @semantic-release/github, and re-running npm i then npm ci the issue was resolved for me.
Confirming, for security and compliance reasons we must keep dependencies pinned (by hashed ref). Any changes have to be scanned and human reviewed before the pins are updated, and this is a process that is already automated.
Further, our CI is ephemeral, and root/global level changes are forbidden.
Switching to an unpinned global install will not fly.
Reacted by Róbert Kiss, Steffen Schroeder and Nikita Lvov
You should provide package.json with as few packages as possible to trigger your bug, so the npm install will finish in seconds, not in minutes. All redundant packages should be removed.
@pochat and @chr4ss12: Please remember that you need to delete node_modules folder and package-lock.json, then do npm install to recreate the correct lock file.
This was working fine up till 11.11.1 and broke again in 11.12.0 (broken in 11.12.1, 11.13.0) - the lock files are created without including optional dependencies.
@dominykas: Sounds like a different bug to me.
Please create a new issue and provide a minimal package.json file for your case, and which packages are missing.
The root cause of this issue was invalid lock files getting created?
But yes, I will create a new issue about this regression.
Edit: quite possibly this only related to npm installs that run with package-lock=false and then use npm shrinkwrap --dev. Might not bother raising an issue, because what's the point.
Point is, invalid lock files are still getting created (if you have package-lock=false to avoid creating them automatically and then use npm shrinkwrap --dev to create them manually).
Or, to be more specific, I think this is related to the hidden lock file which always gets created (I think npm shrinkwrap just copies it over, doesn't it?) - I suspect the node_modules/.package-lock.json is still invalid.
Activity
TheRealWaldo commentedon Nov 21, 2025
Could this be related to #8726?
dominykas commentedon Nov 21, 2025
Earlier issue (closed by the poster): #8669 - this broke in
11.6.2.There's also #8674
nknapp commentedon Nov 21, 2025
We had this problem as well. We are using
@semantic-release/npmin our devDependencies, which in turn usesnpm@^11.6.2as dependency.As long as
npm@11.6.2was in the lock-file, everything was fine, butnpm@11. 6.3now usesnopt@9instead ofnopt@8.1.0.I don't know exactly what's going wrong here, but fix could fix the problem by adding this to our package.json:
tanepiper commentedon Nov 21, 2025
Can confirm -
npm ciwas breaking in our pipeline - npm was updated to11.6.3with the namenoptshowing multiple in the package-lock.jsonRolling back to
11.6.0worked for uskherzieandal commentedon Nov 22, 2025
To those who have
semantic-releasein their dependencies:I was able to fix this issue by uninstalling all
devDependenciesrelated to semantic-release (thanks to semantic-release/semantic-release#3951).According to the updated semantic-release documentation, it’s now recommended not to install semantic-release locally at all. Since it’s a release-time dependency rather than a development dependency, they suggest installing it globally in the CI environment or using
npxduring the release step.After removing the local devDependencies
npm uninstall semantic-release @semantic-release/git @semantic-release/github, and re-runningnpm ithennpm cithe issue was resolved for me.fardarter commentedon Nov 24, 2025
@kherzieandal The reason I want it in my lockfile is so that I get a locked version for supply chain attacks.
SchroederSteffen commentedon Nov 24, 2025
semantic-release/semantic-release#3955
TheRealWaldo commentedon Nov 24, 2025
Confirming, for security and compliance reasons we must keep dependencies pinned (by hashed ref). Any changes have to be scanned and human reviewed before the pins are updated, and this is a process that is already automated.
Further, our CI is ephemeral, and root/global level changes are forbidden.
Switching to an unpinned global install will not fly.
TheRealWaldo commentedon Nov 25, 2025
Also a note; this is not only related to semantic-release.
npm ciis failing in several respects.#8777 #8726 #7622 #8758 #8693 #8740 #8669
liamcmitchell commentedon Dec 8, 2025
Please use npm >= 11.6.3 to generate package-lock and when installing in CI. See problems with lower versions.
TheRealWaldo commentedon Dec 9, 2025
The issue remains with 11.6.3. others have reported the same.
fix(deps): Add npm overrides for Node.js 24 compatibility
chr4ss12 commentedon Feb 13, 2026
yes, the issue is there with the latest version 11.10.0 as well,
basically it broke the every single build we had (10+) with similar errors, complaining about missing lock file, and to fix that, no one has any idea.
should have marked as major release
5 remaining items
pochat commentedon Apr 1, 2026
I ran npm install twice just like @ert78gb suggested and it worked.
Saibamen commentedon Apr 1, 2026
@pochat: Running
npm installtwice shouldn't be needed anymore with the latest npm11.12.1.If you still have this bug with latest NPM, please provide minimal
package.jsonto reproduce this, so we can fix it.pochat commentedon Apr 1, 2026
Hi @Saibamen, thanks for your assistance.
I'll provide the information you requested. What exactly do you need to see for a minimal package.json?
Saibamen commentedon Apr 1, 2026
You should provide package.json with as few packages as possible to trigger your bug, so the
npm installwill finish in seconds, not in minutes. All redundant packages should be removed.pochat commentedon Apr 1, 2026
HI @Saibamen,
Here is the information. I have a fresh install of vuejs and nuxt.
npm -v
11.12.1
Package.json
{
"name": "front_end",
"type": "module",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"nuxt": "^4.4.2",
"vue": "^3.5.31",
"vue-router": "^5.0.4"
}
}
Let me know if you need anything else.
Thank you for your time.
Saibamen commentedon Apr 1, 2026
Your dependencies are working for me without any problems in npm 11.12.1 and the latest NodeJS LTS.
{ "name": "test_npm", "version": "1.0.0", "private": true, "type": "module", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { "nuxt": "^4.4.2", "vue": "^3.5.31", "vue-router": "^5.0.4" } }Repro:
npm installrmdir /s /q node_modulesnpm ci@pochat and @chr4ss12: Please remember that you need to delete
node_modulesfolder andpackage-lock.json, then donpm installto recreate the correct lock file.pochat commentedon Apr 1, 2026
Thank you for your time @Saibamen. I'll give that a try.
pochat commentedon Apr 1, 2026
Hi @Saibamen. It worked. Thanks again!
dominykas commentedon Apr 24, 2026
This was working fine up till 11.11.1 and broke again in 11.12.0 (broken in 11.12.1, 11.13.0) - the lock files are created without including optional dependencies.
Saibamen commentedon Apr 24, 2026
@dominykas: Sounds like a different bug to me.
Please create a new issue and provide a minimal
package.jsonfile for your case, and which packages are missing.dominykas commentedon Apr 24, 2026
There were multiple issues linked to this one:
npm updategenerates package-lock.json that isn't considered in-sync bynpm ci#8674The root cause of this issue was invalid lock files getting created?
But yes, I will create a new issue about this regression.
Edit: quite possibly this only related to
npm installsthat run withpackage-lock=falseand then usenpm shrinkwrap --dev. Might not bother raising an issue, because what's the point.Saibamen commentedon Apr 24, 2026
Yes, you need to recreate the lock file from scratch - delete
node_modulesfolder, remove lock file, runnpm installAnd then you can delete
node_modulesfolder and donpm cito check if you have new errors.dominykas commentedon May 4, 2026
Point is, invalid lock files are still getting created (if you have
package-lock=falseto avoid creating them automatically and then usenpm shrinkwrap --devto create them manually).Or, to be more specific, I think this is related to the hidden lock file which always gets created (I think
npm shrinkwrapjust copies it over, doesn't it?) - I suspect thenode_modules/.package-lock.jsonis still invalid.Fix github action fails
Pin npm to 11.6.2 in EAS builds to dodge npm ci lockfile regression