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 - react+百度地圖2. html5 - iOS的webview加載出來的H5網頁,怎么修改html標簽select的樣式字體?3. vue.js - vue+webpack+vue-router 部署到nginx服務器下,非根目錄,前后端怎樣配置文件?4. javascript - 為什么當index等于5的時候,不在當前頁面跳轉到百度?不跳轉的代碼在倒數第五行5. angular.js - 關于angular react vue 我們在什么實際的開發項目中使用?如何選擇?6. 手動啟動mysql服務出錯,1067錯誤,如何解決呢?7. index.php錯誤,求指點8. 這是什么情況???9. 請教一條mysql的sql語句寫法;10. 跟著課件一模一樣的操作使用tp6,出現了錯誤
