0

ng serve Response: An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' Require stack:

I tried npm install --save-dev @angular-devkit/build-angular

Response:

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.
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.
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.```


Any Solution to solve. Let me know.

1 Answer 1

5

Just ran into this, my installation was interrupted midway and some packages were corrupted as a result.

The solution is pretty straightforward. Just delete the node_modules folder and the file package-lock.json then re-install the modules. The full command should be:

rm -rf node_modules
rm package-lock.json
npm install --save-dev @angular-devkit/build-angular
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.