在ReactJ中安装软件包时的NPM错误
当我尝试安装任何NPM软件包时,我会收到以下错误。并且安装被卡住了。
我粘贴了下面的错误
错误msg:
此版本的NPM与lockfileversion@1兼容,但是package-lock.json是为lockfileversion@2生成的。我会尽力尽最大努力
! https://i.sstatic.net/bvqra.png“ alt =“错误屏幕截图”>
帮助我解决此问题。提前致谢。
When I try to install any npm package, I get the following error. And the installation gets stuck.
I've pasted the error below
Error msg:
This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
Help me to solve this problem. Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您提到的错误消息是由于您正在运行
npm
的旧版本。当您的package-lock.json
使用V7+生成时,您可能在V5或V6上。但是,该消息通常是一个警告,而不是最终错误。会仔细检查是否也有其他错误消息。
package-lock.json
版本的更多详细信息: https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json#lockfileversionThe error message you mentioned is due to the fact that you are running an older version of
npm
. You are probably on v5 or v6 while yourpackage-lock.json
was generated with v7+.However, that message is usually a warning, and not a final error. Would double check to see if you have other error messages as well.
More details for
package-lock.json
versions at: https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json#lockfileversion