qq_35002601
2021-08-11 08:57
采纳率: 100%
浏览 44
已结题

npm安装出现的问题。下面是npm-debug.log内容


0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'mime',
1 verbose cli   '--save' ]
2 info using npm@3.10.10
3 info using node@v6.11.2
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData mime
8 silly fetchNamedPackageData mime
9 silly mapToRegistry name mime
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry http://registry.cnpmjs.org/
12 silly mapToRegistry data Result {
12 silly mapToRegistry   raw: 'mime',
12 silly mapToRegistry   scope: null,
12 silly mapToRegistry   escapedName: 'mime',
12 silly mapToRegistry   name: 'mime',
12 silly mapToRegistry   rawSpec: '',
12 silly mapToRegistry   spec: 'latest',
12 silly mapToRegistry   type: 'tag' }
13 silly mapToRegistry uri http://registry.cnpmjs.org/mime
14 verbose request uri http://registry.cnpmjs.org/mime
15 verbose request no auth needed
16 info attempt registry request try #1 at 08:50:45
17 verbose request id c70568054866066a
18 http request GET http://registry.cnpmjs.org/mime
19 info retry will retry, error on last attempt: Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org"
20 info attempt registry request try #2 at 08:50:55
21 http request GET http://registry.cnpmjs.org/mime
22 info retry will retry, error on last attempt: Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org"
23 info attempt registry request try #3 at 08:51:56
24 http request GET http://registry.cnpmjs.org/mime
25 silly fetchPackageMetaData Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org"
25 silly fetchPackageMetaData     at Object.checkServerIdentity (tls.js:199:17)
25 silly fetchPackageMetaData     at TLSSocket.<anonymous> (_tls_wrap.js:1098:29)
25 silly fetchPackageMetaData     at emitNone (events.js:86:13)
25 silly fetchPackageMetaData     at TLSSocket.emit (events.js:185:7)
25 silly fetchPackageMetaData     at TLSSocket._finishInit (_tls_wrap.js:610:8)
25 silly fetchPackageMetaData     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
25 silly fetchPackageMetaData  error for mime { Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org"
25 silly fetchPackageMetaData     at Object.checkServerIdentity (tls.js:199:17)
25 silly fetchPackageMetaData     at TLSSocket.<anonymous> (_tls_wrap.js:1098:29)
25 silly fetchPackageMetaData     at emitNone (events.js:86:13)
25 silly fetchPackageMetaData     at TLSSocket.emit (events.js:185:7)
25 silly fetchPackageMetaData     at TLSSocket._finishInit (_tls_wrap.js:610:8)
25 silly fetchPackageMetaData     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
25 silly fetchPackageMetaData   reason: 'Host: registry.cnpmjs.org. is not in the cert\'s altnames: DNS:r.cnpmjs.org',
25 silly fetchPackageMetaData   host: 'registry.cnpmjs.org',
25 silly fetchPackageMetaData   cert:
25 silly fetchPackageMetaData    { subject: { CN: 'r.cnpmjs.org' },
25 silly fetchPackageMetaData      issuer: { C: 'US', O: 'Let\'s Encrypt', CN: 'R3' },
25 silly fetchPackageMetaData      subjectaltname: 'DNS:r.cnpmjs.org',
25 silly fetchPackageMetaData      infoAccess: { 'OCSP - URI': [Object], 'CA Issuers - URI': [Object] },
25 silly fetchPackageMetaData      modulus: 'C1A6A9BE4BCA73127A2BC3F9B34952E71FD009ACFB1DE9FBB9084EE5F9F3352F5728B2F5E062CDF9A1CC7908FC0A5C074FEEA39474A45C2563265251733C10EAF2A9150FC9644D2DDEBEBB16CCEB881750677215471A0D6A68E15EFD580DAAB8FFA97B65F5DEE9FFE2FD66D00CAACA7A2814710330676E52D7055D11EF043701C9A74654900E13098904D9DF4DD56188C1D007D1DA9ED1FAC1514221CD0194EEC0F12599207C1524BAA46DE406CAFD9793CC8C0F9E2C9CD8125607B53147FD5E7BEDF45E11575EBEF8C05FD035CD2A8CB6E1F1B15A0A938EFE1B6617B9C7F983193234EC9576CE20D9F5ED3438BFF1068F948427207DCE5E16C213460B5B22F3',
25 silly fetchPackageMetaData      exponent: '0x10001',
25 silly fetchPackageMetaData      valid_from: 'Jul 28 15:10:29 2021 GMT',
25 silly fetchPackageMetaData      valid_to: 'Oct 26 15:10:27 2021 GMT',
25 silly fetchPackageMetaData      fingerprint: 'F6:97:06:85:8E:9E:11:3C:66:5C:C0:C3:E1:7B:5D:33:D5:A0:94:76',
25 silly fetchPackageMetaData      ext_key_usage: [ '1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2' ],
25 silly fetchPackageMetaData      serialNumber: '0470CEF091B3C9548D6D40DCBE35D4A935B0',
25 silly fetchPackageMetaData      raw: <Buffer 30 82 05 1c 30 82 04 04 a0 03 02 01 02 02 12 04 70 ce f0 91 b3 c9 54 8d 6d 40 dc be 35 d4 a9 35 b0 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 32 ... > } }
26 silly rollbackFailedOptional Starting
27 silly rollbackFailedOptional Finishing
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.
- org"
30 verbose stack     at Object.checkServerIdentity (tls.js:199:17)
30 verbose stack     at TLSSocket.<anonymous> (_tls_wrap.js:1098:29)
30 verbose stack     at emitNone (events.js:86:13)
30 verbose stack     at TLSSocket.emit (events.js:185:7)
30 verbose stack     at TLSSocket._finishInit (_tls_wrap.js:610:8)
30 verbose stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
31 verbose cwd C:\Users\Administrator\Desktop\node.js\03\hackernews
32 error Windows_NT 10.0.19041
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mime" "--save"
34 error node v6.11.2
35 error npm  v3.10.10
36 error Hostname/IP doesn't match certificate's altnames: "Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org"
37 error If you need help, you may report this error at:
37 error     <https://github.com/npm/npm/issues>
38 verbose exit [ 1, true ]

  • 收藏

1条回答 默认 最新

  • Alice_czy 2021-08-11 09:25
    已采纳

    错误信息:Hostname/IP doesn't match certificate's altnames : 主机名/IP与证书的别名不匹配

    因为npm install走的是https协议,需要通过数字证书来保证的

    解决方案:
    //取消ssl验证

    npm set strict-ssl false 
    
    npm config set registry http://registry.npmjs.org/
    
    
    

    //如果还没成功,则将npm源更换为国内镜像:

    npm config set registry http://registry.cnpmjs.org/
    npm config set registry http://registry.npm.taobao.org/
    
    
    
    1 打赏 评论

相关推荐 更多相似问题