npm was told to use npm-shrinkwrap.json but the file is missing or not in the current directory. Commit or generate it, or switch to package-lock.json before rerunning.
npm prefers npm-shrinkwrap.json over package-lock.json when present. Some CI setups or older npm versions expect that file; if it is missing, renamed, or not checked in, fs.open fails with ENOENT and npm stops. This often happens after deleting the shrinkwrap file, migrating to package-lock without updating scripts, or in monorepos where the current directory differs from where the shrinkwrap lives.
pwd
ls npm-shrinkwrap.jsonIf missing, ensure you are in the package root that owns the shrinkwrap.
git checkout -- npm-shrinkwrap.json || true
npm shrinkwrapCommit the file if your pipeline expects it.
If your project uses package-lock.json, update CI scripts to stop requiring shrinkwrap and ensure package-lock is committed.
rm -rf node_modules package-lock.json npm-shrinkwrap.json
npm install --package-lock-only
npm cinpm resolves to npm-shrinkwrap.json before package-lock.json; keeping both can confuse CIβpick one. If you migrate off shrinkwrap, update npm to v7+ and remove scripts that expect it. In workspaces, each package may manage its own lock; ensure the shrinkwrap is committed for each published package to preserve exact versions.
npm notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm
npm error code E403 npm error 403 Forbidden - PUT https://registry.npmjs.org/<package>
How to fix 'E403 Forbidden' error in npm
Run npm from the package directory that owns the shrinkwrap. Each package can have its own lock; ensure the correct one exists.