npm WARN read-shrinkwrap 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!
npm install 报错npm WARN read-shrinkwrap 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!
从报错信息可以知道: 你当前的npm版本是lockfileVersion@1
,但是你项目的package-lock.json是 lockfileVersion@2的,代码中的某个插件只能用特定的npm版本,因而你需要更新的你的npm
更新命令:
npm install -g npm
注意:这里cmd一定要用 管理员 身份运行,不然提示无权限!!!
或者 windows键加 x ,然后按 i 调出power shell页面。然后运行指令
升级后版本就会显示升级后的版本
升级后即可以npm install 成功