npm安装淘宝镜像出现下图的情况怎么办

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

阅读 5k
评论 2017-03-11 提问
    4 个回答
    lucifer
    • 3.2k
    评论 赞赏 2017-03-11

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

      评论 赞赏 2017-03-11
        EliYao
        • 3
        • 新人请关照

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

        评论 赞赏 2017-03-12
          gaoxing
          • 4
          • 新人请关照

          推荐使用nrm,简单无痛

          $ npm i nrm -g
          $ nrm ls
          $ nrm use <你中意的源>
          评论 赞赏 2017-03-13
            撰写回答

            登录后参与交流、获取后续更新提醒