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. docker安裝后出現Cannot connect to the Docker daemon.2. 為什么我ping不通我的docker容器呢???3. android - webview 自定義加載進度條4. mysql - 怎么讓 SELECT 1+null 等于 15. javascript - 微信音樂分享6. 網頁爬蟲 - 用Python3的requests庫模擬登陸Bilibili總是提示驗證碼錯誤怎么辦?7. javascript - 微信小程序封裝定位問題(封裝異步并可能多次請求)8. 并發模型 - python將進程池放在裝飾器里為什么不生效也沒報錯9. linux - openSUSE 上,如何使用 QQ?10. python 怎樣用pickle保存類的實例?
