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
你沒依照官網給的去安啊。 registry 。 應該是npm install -g cnpm --registry=https://registry.npm.taobao.org
錯誤原因是這個:
unable to verify the first certificate
字面意思是跟證書有關係的
幫你百度了下:
傳送門
Windows 下裝 cnpm 本來就比較慘,推薦使用 nrm 換 registry 方式使用 cnpm 來源。
推薦使用nrm,簡單無痛