4 months ago
Allthough my dependencies are ok : clean npm install, I still get this build error : npm error code EUSAGE
npm error
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: yaml@2.8.2 from lock file
npm error
yaml@2.8.2 is present in in node_modules and also in package.json
1 Replies
4 months ago
Your package-lock.json is outdated. npm ci is strict and requires the lockfile to perfectly match package.json. Even if the package is in node_modules, it is missing from the lockfile's dependency tree.
The Fix:
Run this command locally to update your lockfile:
npm install
You must commit and push the updated package-lock.json to your repository. The build server (which runs npm ci) needs the updated lockfile to proceed.
If running npm install doesn't make the error go away, force a complete regeneration of the lockfile:
- Delete
node_modulesandpackage-lock.json. - Run
npm install. - Commit the new
package-lock.json.
