安装 插件时 报错问题
错误
D:\vuejs\webpackdemo\democonfig>npm install html-webpack-plugin -g
npm ERR! Only HTTP(S) protocols are supported
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache_logs\2021-06-16T00_41_16_636Z-debug.log
这个是因为HTTPS的设置问题,可以有两种办法解决:
- 关掉SSL检测
- 使用HTTP连接的安装源
- 命令如下:
# 关闭SSL检查
npm config set strict-ssl false
# 使用http安装源
npm config set registry="http://registry.npmjs.org/"