Npm安装引发警告旧锁定文件错误



npm 8.1.2|node 16.13.1

Npm在我使用npm install时抛出了以下错误,我相信这是关于版本的,但不确定,我安装了npm版本7.19.1,但仍然得到了相同的错误,知道为什么以及如何解决这个问题吗?

npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the 
future

这意味着package-lock.json文件是在执行npm版本小于7的npm install时创建的。

npm 7不仅改变了package-lock.json的格式,还改变了它处理对等依赖关系的方式。当您升级到较新的npm版本(>=7(时,请确保使用仍然具有旧文件版本的新签出的repo正确测试所有内容。

您可以通过提交并推送新格式的package-lock.json来解决问题(当所有测试都进行得很顺利时(。

最新更新