sweeney
sweeney

Reputation: 15

npm install - npm Warning of Damaged Lockfile

I am trying to run npm install and am receiving an error of a damaged lockfile:

npm warn reify invalid or damaged lockfile detected
npm warn reify please re-try this operation once it completes
npm warn reify so that the damage can be corrected, or perform
npm warn reify a fresh install with no lockfile if the problem persists

I have tried removing node_modules/package-lock and force clearing npm cache then reinstalling with

rm -rf node_modules/ package-lock.json
npm cache clear --force
npm install

npm install will work the first time, but it and npm prune will throw the error seen above after first install.

I've also tried just removing package-lock (not node_modules) and trying the above. Everything I've seen mentions the above steps and seems to remediate the issue for others

Upvotes: 0

Views: 50

Answers (1)

sweeney
sweeney

Reputation: 15

It turns out I had an override for a dependency that was causing a security issue in my package.json.

It seems as though this was nuking my dependency tree and causing npm install to build a bad package-lock file.

Upvotes: 0

Related Questions