node.js - npm安装淘宝镜像出现下图的情况怎么办
天蓬老师
天蓬老师 2017-04-17 16:14:56
0
4
671

C:UsersAdministrator>npm install -g cnpm --registry=https://regi
o.org --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\Program Files\nodejs\node.exe',
npm verb cli 'C:\Program Files\nodejs\node_modules\npm\bin\
npm verb cli 'install',
npm verb cli '-g',
npm verb cli 'cnpm',
npm verb cli '--registry=https://registry.npm.taobao.org',
npm verb cli '--verbose' ]
npm info using npm@3.10.10
npm info using node@v6.10.0
npm verb request uri https://registry.npm.taobao.o...
npm verb request no auth needed
npm info attempt registry request try #1 at 17:27:29
npm verb request id 76ca2edeba60bead
npm http request GET https://registry.npm.taobao.o...
npm info retry will retry, error on last attempt: Error: unable to
rst certificate
npm info attempt registry request try #2 at 17:27:39
npm http request GET https://registry.npm.taobao.o...
npm info retry will retry, error on last attempt: Error: unable to
rst certificate
npm info attempt registry request try #3 at 17:28:39
npm http request GET https://registry.npm.taobao.o...
npm verb stack Error: unable to verify the first certificate
npm verb stack at Error (native)
npm verb stack at TLSSocket.<anonymous> (_tls_wrap.js:1085:38)
npm verb stack at emitNone (events.js:86:13)
npm verb stack at TLSSocket.emit (events.js:185:7)
npm verb stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
npm verb stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:43
npm verb cwd C:UsersAdministrator
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program F
node_modules\npm\bin\npm-cli.js" "install" "-g" "cnpm" "--regis
gistry.npm.taobao.org" "--verbose"
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! https://github.com/npm/npm/is...
npm verb exit [ 1, true ]

npm ERR! Please include the following file with any support reques
npm ERR! C:UsersAdministratornpm-debug.log

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(4)
迷茫

你没按照官网给的去安啊。 registry 。 应该是npm install -g cnpm --registry=https://registry.npm.taobao.org

伊谢尔伦

错误原因是这个:
unable to verify the first certificate
字面意思是跟证书有关系的
帮你百度了下:
传送门

小葫芦

Windows 下装 cnpm 本来就比较惨,推荐使用 nrm 换 registry 方式使用 cnpm 源。

洪涛

推荐使用nrm,简单无痛

$ npm i nrm -g
$ nrm ls
$ nrm use <你中意的源>
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板