npm EUSAGE "Usage:" - Fix Invalid npm Command or Flags in CI
EUSAGE is npm telling you the command itself was used incorrectly - an unknown subcommand, a removed flag, or missing/extra arguments. It prints a usage block and exits before doing any work.
What this error means
An npm step fails with npm error code EUSAGE followed by a Usage: block for the command you ran. The arguments or flags you passed are not valid for this npm version.
npm output
npm error code EUSAGE
npm error
npm error Unknown command: "isntall"
npm error
npm error Usage: npm install [<package-spec> ...]Common causes
Typo or unknown subcommand
A misspelled command (npm isntall) or a subcommand that does not exist produces EUSAGE with the correct usage.
A removed or renamed flag
A flag that existed in an older npm (or never existed) is rejected. For example, mixing up --omit=dev with old --only/--production forms.
How to fix it
Correct the command to match the usage block
Read the printed usage and fix the subcommand or flags.
Terminal
# wrong
npm isntall --only=prod
# right
npm install --omit=dev
# inspect valid flags
npm install --helpAlign scripts with the installed npm
- Check the npm version (
npm --version) the CI image ships. - Replace deprecated/removed flags with their current equivalents.
- Run
npm <command> --helpto confirm the exact accepted syntax.
How to prevent it
- Pin and know the npm version your CI uses.
- Prefer current flags (
--omit/--include) over legacy ones. - Lint CI scripts for stale npm invocations.
Related guides
npm "warn config … deprecated" - Fix Deprecated .npmrc Settings in CIFix npm "npm warn config … is deprecated" noise in CI - old .npmrc keys (e.g. cache-min, production, optional…
npm ENOLOCAL "Could not install from … as it does not contain a package.json"Fix npm ENOLOCAL in CI - npm treated a dependency spec as a local path and could not find a package there. Us…
npm EJSONPARSE "Failed to parse JSON" - Fix a Broken package.json in CIFix npm EJSONPARSE "Failed to parse JSON data" in CI - an invalid package.json (trailing comma, comment, or m…