在Vue项目中引入Echart(使用npm install
指令)的时候报错:
PS G:> npm install 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 This is a one-time fix-up, please be patient... npm WARN old lockfile npm ERR! code EINVALIDPACKAGENAME npm ERR! Invalid package name "_@ampproject_remapping@2.1.2@@ampproject": name cannot start with an underscore; name can only contain URL-friendly characters npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\胜胜\AppData\Local\npm-cache\_logs\2022-04-08T15_40_42_658Z-debug.log
原因是package-lock.json
这个文件在创建的时候使用了旧版本的npm
,其必须从注册表中获取补充元数据。
使用cnpm install
指令即可顺利安装相应的依赖。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/233487.html原文链接:https://javaforall.net