安装 Vue CLI 报错

报错

npm install -g @vue/cli
npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! request to https://registry.cnpmjs.org/@vue%2fcli failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Andro\AppData\Roaming\npm-cache\_logs\2021-04-14T15_48_10_569Z-debug.log

解决方案

npm config set strict-ssl false

你可能感兴趣的:(Web前端,vue-cli3)