can't deploy my react project portfolio
fredericbalcer
HOBBYOP

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

$10 Bounty

1 Replies

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:

  1. Delete node_modules and package-lock.json.
  2. Run npm install.
  3. Commit the new package-lock.json.

Welcome!

Sign in to your Railway account to join the conversation.

Loading...