javascript - Node 用 Npm安装东西(vue 淘宝镜像等)都出错?如下图,请问怎么解决?
ringa_lee
ringa_lee 2017-04-11 13:15:06
[JavaScript讨论组]

安装 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
ringa_lee
ringa_lee

ringa_lee

全部回复(5)
PHPz

你用的http协议,请关闭npm的https
执行以下命令后,再尝试

npm config set strict-ssl false
天蓬老师

看下是不是淘宝镜像的地址输入错误,比如协议应该是 https,而不是 http

阿神

npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose

黄舟

这是npm淘宝镜像的官方 有配置说明 https://npm.taobao.org/
看你的问题 是找不到镜像里的库 根本问题在于淘宝镜像用的是 https 协议而非 http

黄舟

我也遇到这个问题了,我是在安装node的时候自定义目录了,不是默认的,所以安装这个淘宝镜像出错

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号