npm install error, stuck and solution (mac)

1. Prompt when npm install: npm ERR! Unexpected end of JSON input while parsing near '... PGP SIGNATURE-----\r'
Solution:

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

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

2. When npm install, I found that it has been stuck. fetchMetadata: sill install loadAllDepsIntoIdealTree
Reason: The installation is too slow. You can wait patiently or install the Taobao mirror

solution:

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

3. npm run dev prompt: sh: vue-cli-service: command not found
insert image description here
solution: mac error: sh: vue-cli-service: command not found
terminal execution command

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

When npm install reports an error, use the command cnpm install
and execute it finally: npm run dev
insert image description here
finally succeeded! ! !

Guess you like

Origin blog.csdn.net/qq_34663267/article/details/117992377