安装vue-cli脚手架出错:
npm install @vue/cli -g
出现错误
错误1:
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
解决方法:需要清一下缓存,再执行该指令
npm cache clean --force
npm install @vue/cli -g
检验安装vue-cl是否成功
vue --version
vue -V
错误2:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
解决方法:自己的npm设置了代理,请把代理去掉,如下命令:
npm config delete proxy
或
npm config delete https-proxy
npm install @vue/cli -g
继续检验安装vue-cl是否成功
vue --version
vue -V
安装较慢时,使用淘宝镜像cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org