npm install报错,卡顿及解决方案(mac)

一、 npm install时提示:npm ERR! Unexpected end of JSON input while parsing near '... PGP SIGNATURE-----\r'
解决方案:

npm cache clean --force // 如果出现提示npm WARN using --force I sure hope you know what you are doing 则表示清除成功

npm install // 再次执行npn install即可

二、npm install时发现一直卡在fetchMetadata: sill install loadAllDepsIntoIdealTree
原因:安装过慢导致的,可耐心等待或者安装淘宝镜像

解决方案:

npm  install node-sass \--registry=http://registry.npm.taobao.org // 从淘宝镜像安装

三、npm run dev提示:sh: vue-cli-service: command not found
在这里插入图片描述
解决方案:mac 报错:sh: vue-cli-service: command not found
终端执行命令

#清除缓冲
npm cache clean --force   
#重新安装
npm/cnpm  install

npm install报错就用命令cnpm install
最后再执行:npm run dev
在这里插入图片描述
终于成功了!!!

猜你喜欢

转载自blog.csdn.net/qq_34663267/article/details/117992377
今日推荐