node.js - npm安装淘宝镜像出现下图的情况怎么办
问题描述
C:UsersAdministrator>npm install -g cnpm --registry=https://regio.org --verbosenpm info it worked if it ends with oknpm verb cli [ ’C:Program Filesnodejsnode.exe’,npm verb cli ’C:Program Filesnodejsnode_modulesnpmbinnpm 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.10npm info using node@v6.10.0npm verb request uri https://registry.npm.taobao.o...npm verb request no auth needednpm info attempt registry request try #1 at 17:27:29npm verb request id 76ca2edeba60beadnpm http request GET https://registry.npm.taobao.o...npm info retry will retry, error on last attempt: Error: unable torst certificatenpm info attempt registry request try #2 at 17:27:39npm http request GET https://registry.npm.taobao.o...npm info retry will retry, error on last attempt: Error: unable torst certificatenpm info attempt registry request try #3 at 17:28:39npm http request GET https://registry.npm.taobao.o...npm verb stack Error: unable to verify the first certificatenpm 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:43npm verb cwd C:UsersAdministratornpm ERR! Windows_NT 6.1.7601npm ERR! argv 'C:Program Filesnodejsnode.exe' 'C:Program Fnode_modulesnpmbinnpm-cli.js' 'install' '-g' 'cnpm' '--regisgistry.npm.taobao.org' '--verbose'npm ERR! node v6.10.0npm ERR! npm v3.10.10npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! unable to verify the first certificatenpm 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 requesnpm ERR! C:UsersAdministratornpm-debug.log
问题解答
回答1:你没按照官网给的去安啊。 registry 。 应该是npm install -g cnpm --registry=https://registry.npm.taobao.org
回答2:错误原因是这个:unable to verify the first certificate字面意思是跟证书有关系的帮你百度了下:传送门
回答3:Windows 下装 cnpm 本来就比较惨,推荐使用 nrm 换 registry 方式使用 cnpm 源。
回答4:推荐使用nrm,简单无痛
$ npm i nrm -g$ nrm ls$ nrm use <你中意的源>
相关文章:
1. javascript - 如何用最快的速度C#或Python开发一个桌面应用程序来访问我的网站?2. java - springMVC配置的controller无法返回jsp文件3. javascript - weex和node,js到底是怎样一个关系呢?4. javascript - 项目用IE浏览器打开修改前端内容,后台数据修改了,但是前端页面内容不变,用谷歌浏览器测试前端页面可以刷新,求大神解决。5. mysql 存储过程 和 函数有什么用??6. python - 关于beautifulsoup获取文档内容7. android的checkbox在xml添加和在java代码中添加样式不一样?8. javascript - 看一些高手写代码单独用 “$”和“_” 来表示变量,什么时候单独使用这两个字符?9. 前端 - 使用vue2服务端渲染的时候,如何在服务端请求数据,然后给vue渲染10. mysql - jdbc的问题
