The ELOCKVERIFY error occurs when package-lock.json and package.json are out of sync. This ensures reproducible builds by detecting when dependencies have changed.
npm ci (and npm install with certain flags) verifies that package-lock.json matches package.json. If they're out of sync - different versions, missing packages, or extra packages - npm refuses to proceed. This verification ensures reproducible builds. The lock file should exactly match what package.json specifies, and any changes should be intentional and committed together.
Create fresh lock file:
rm package-lock.json
npm installThis creates a new lock file matching package.json.
npm install updates the lock file:
npm install
# Then commit the updated lock file
git add package-lock.json
git commit -m "Update package-lock.json"Look for conflict markers:
grep -n "<<<<<<" package-lock.json
grep -n "======" package-lock.json
grep -n ">>>>>>" package-lock.jsonResolve by regenerating lock file.
Different npm versions may create different locks:
# Check your version
npm --version
# Check version in lockfileVersion field
cat package-lock.json | grep lockfileVersionMatch CI to local npm:
# GitHub Actions
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"Ensure lock matches package.json:
# See what differs
npm ls
# After package.json changes, always:
npm install
git add package.json package-lock.json
git commit -m "Add/update dependency"Always commit package-lock.json to version control. Use npm ci in CI/CD for reproducible builds. Different npm versions (especially major versions) may generate incompatible lock files. Consider adding npm version to .nvmrc or engines field. In monorepos with workspaces, workspace lock file must be in sync with all workspace package.json files.
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error