npm install webpack -g
报错if you are behind a proxy,please make sure that the 'proxy' cinfig is set properly.
错误信息提示:若配置了代理,请确认代理被合理配置。因此去设置npm代理
执行npm config set proxy http://proxy.example.com:8080
参考https://qiita.com/tenten0213/items/7ca15ce8b54acc3b5719
然后重新执行npm install webpack -g
,又报错
提示:服务器出错,重新配置npm镜像地址
执行npm config set registry http://registry.npmjs.org/
终于,webpack安装成功了。