安装 vue-cli 或者其他任何东西 都出现以下错误。
$ npm install -g cnpm --registry=http://registry.npm.taobao.org
npm ERR! fetch failed http://registry.npm.taobao.org/cnpm/download/cnpm-4.5.0.tgz
npm WARN retry will retry, error on last attempt: Error: unable to verify the first certificate
npm ERR! fetch failed http://registry.npm.taobao.org/cnpm/download/cnpm-4.5.0.tgz
npm WARN retry will retry, error on last attempt: Error: unable to verify the first certificate
$ cnpm -v
npm ERR! fetch failed http://registry.npm.taobao.org/cnpm/download/cnpm-4.5.0.tgz
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cnpm" "--registry=http://registry.npm.taobao.org"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! unable to verify the first certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\bestsu\npm-debug.log
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你用的
http协议,请关闭npm的https执行以下命令后,再尝试
看下是不是淘宝镜像的地址输入错误,比如协议应该是
https,而不是httpnpm install -g cnpm --registry=https://registry.npm.taobao.org --verbose
这是npm淘宝镜像的官方 有配置说明 https://npm.taobao.org/
看你的问题 是找不到镜像里的库 根本问题在于淘宝镜像用的是 http
s协议而非 http我也遇到这个问题了,我是在安装node的时候自定义目录了,不是默认的,所以安装这个淘宝镜像出错