Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
544 views
in Technique[技术] by (71.8m points)

node.js - Npm install gives warnings, npm audit fix not working

I am working on an angular app with a .net core web api.

When I cloned this repository, I tried to run npm install on the angular application, but I got a strange error:

npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

audited 34090 packages in 14.711s
found 15 vulnerabilities (9 low, 6 high)
  run `npm audit fix` to fix them, or `npm audit` for details 

Also, if I try to do npm audit fix, I get even more errors:


npm audit fix
npm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run  npm install  to fix them.
npm ERR!     Invalid: lock file's @progress/kendo-theme-default@file:https:/registry.npmjs.org/@progress/kendo-theme-default/-/kendo-theme-default-2.48.1.tgz does not satisfy @progress/kendo-theme-default@file:lib/kendo-theme-default
npm ERR!     Invalid: lock file's bootstrap@file:https:/registry.npmjs.org/bootstrap/-/bootstrap-4.0.0.tgz does not satisfy bootstrap@file:lib/bootstrap

How can I resolve this?

question from:https://stackoverflow.com/questions/53089810/npm-install-gives-warnings-npm-audit-fix-not-working

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Often times, this is related to package-lock.json messing. I would suggest to try to:

1 - Delete your package-lock.json

2 - Delete your node_modules folder

3 - Try npm install again

This used to fix several issues when adding new packages in my angular apps.

Good luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...