我正在开发一个带有.net core web api的角度应用程序。
当我克隆这个存储库时,我尝试在 Angular 应用程序上运行 npm install ,但出现了一个奇怪的错误:
npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: 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
此外,如果我尝试执行 npm audit fix,我会收到更多错误:
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
我该如何解决这个问题?
原文由 Ayush M. 发布,翻译遵循 CC BY-SA 4.0 许可协议
通常,这与
package-lock.json
搞砸有关。我建议尝试:删除你的
package-lock.json
删除您的
node_modules
文件夹再试一次
npm install
这用于在我的 Angular 应用程序中添加新包时解决几个问题。
祝你好运!
请注意,从那时起,发生了很大变化,现在有另一个选项可以使用
ncu
来整合更新。在使用此解决方案之前可能值得尝试。该线程的另一个响应中描述了替代解决方案,请参阅它。