npm expected package-lock.json (especially for npm ci) but could not find it. Regenerate the lockfile, or use npm install --package-lock-only before npm ci.
Fixes npm ERR! Error: ENOENT: no such file or directory, open 'package-lock.json'
pwd
ls package.json package-lock.json npm-shrinkwrap.jsonpwdls package.json package-lock.json npm-shrinkwrap.jsonnpm ERR! Error: ENOENT: no such file or directory, open 'package-lock.json'
On this page
npm ci requires an existing package-lock.json. If the lockfile was deleted, not checked in, or you are in the wrong directory, npm throws ENOENT. Merge conflicts can also remove/rename the file. In monorepos, the lockfile may live at the workspace root rather than the package folder.
pwd
ls package.json package-lock.json npm-shrinkwrap.jsonIn monorepos, ensure you are at the root that owns the lockfile.
npm install --package-lock-onlyIf lockfile was deleted/corrupted, recreate it before npm ci.
Once package-lock.json is present and committed, run npm ci for deterministic installs.
If the project uses npm-shrinkwrap.json instead, ensure it is present or remove references if you standardized on package-lock.json.
Always commit package-lock.json for reproducibility. Resolve merge conflicts carefully; if in doubt, regenerate via npm install --package-lock-only. Workspaces may share a single root lockfile—run installs from that root.