npm 下载依赖报错npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintain

735 阅读1分钟

从github拉取的项目安装依赖报错,报错信息如下:

npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

通过输入 npm outdated后,显示项目package配置信息:

Package                     Current  Wanted  Latest  Location                                    
core-js                      3.20.1  3.22.8  3.22.8  node_modules/core-js                     

全局下载core-js,在重新安装依赖 npm install ,查看是否还报错

npm install --save -g core-js@^3

如果还是报错清一下缓存,

npm cache clear --force

再重新安装依赖npm install,安装成功后运行项目 npm run dev