gpt4 book ai didi

javascript - 在 Windows 10 机器上安装 Node 模块的问题

转载 作者:行者123 更新时间:2023-11-30 15:27:44 27 4
gpt4 key购买 nike

在全新安装 nodejs 后,我在将任何模块安装到我的 Windows 10 机器上时遇到问题。

这是我的笔记本电脑,所以我有完全访问权限等。

我看了很多论坛,似乎没有一个明确的答案来解决这个问题。

npm-debug 返回以下内容:

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 '-g',

1 verbose cli 'express-generator' ]

2 info using npm@3.10.10

3 info using node@v6.10.0

4 silly loadCurrentTree Starting

5 silly install loadCurrentTree

6 silly install readGlobalPackageData

7 silly fetchPackageMetaData express-generator

8 silly fetchNamedPackageData express-generator

9 silly mapToRegistry name express-generator

10 silly mapToRegistry using default registry

11 silly mapToRegistry registry https://registry.npmjs.org/

12 silly mapToRegistry data Result {

12 silly mapToRegistry raw: 'express-generator',

12 silly mapToRegistry scope: null,

12 silly mapToRegistry escapedName: 'express-generator',

12 silly mapToRegistry name: 'express-generator',

12 silly mapToRegistry rawSpec: '',

12 silly mapToRegistry spec: 'latest',

12 silly mapToRegistry type: 'tag' }

13 silly mapToRegistry uri (link to express generator)

14 verbose request uri (link to express generator)

15 verbose request no auth needed

16 info attempt registry request try #1 at 9:25:54 PM

17 verbose request id 10ea30ec4da3c14a

18 http request GET (link to express generator)

19 info retry will retry, error on last attempt: Error: write EPROTO
101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20

19 info retry 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

20 info attempt registry request try #2 at 9:26:05 PM

21 http request GET https://registry.npmjs.org/express-generator

22 info retry will retry, error on last attempt: Error: write EPROTO 101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20

22 info retry 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

23 info attempt registry request try #3 at 9:27:05 PM

24 http request GET (link to express generator)

25 silly fetchPackageMetaData Error: write EPROTO 101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20

25 silly fetchPackageMetaData 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

25 silly fetchPackageMetaData

25 silly fetchPackageMetaData at exports._errnoException (util.js:1022:11)

25 silly fetchPackageMetaData at WriteWrap.afterWrite (net.js:801:14)

25 silly fetchPackageMetaData error for express-generator { Error: write EPROTO 101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20

25 silly fetchPackageMetaData 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

25 silly fetchPackageMetaData

25 silly fetchPackageMetaData at exports._errnoException (util.js:1022:11)

25 silly fetchPackageMetaData at WriteWrap.afterWrite (net.js:801:14) code: 'EPROTO', errno: 'EPROTO', syscall: 'write' }

26 silly rollbackFailedOptional Starting

27 silly rollbackFailedOptional Finishing

28 silly runTopLevelLifecycles Finishing

29 silly install printInstalled

30 verbose stack Error: write EPROTO 101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20

30 verbose stack 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

30 verbose stack

30 verbose stack at exports._errnoException (util.js:1022:11)

30 verbose stack at WriteWrap.afterWrite (net.js:801:14)

31 verbose cwd C:\Users\stu\Desktop\node

32 error Windows_NT 10.0.14393

33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "express-generator"

34 error node v6.10.0

35 error npm v3.10.10

36 error code EPROTO

37 error errno EPROTO

38 error syscall write

39 error write EPROTO 101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20

39 error 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

40 error If you need help, you may report this error at:

40 error github issues link

41 verbose exit [ 1, true ]

任何帮助都会很棒。

最佳答案

您使用的是旧版本的 npm (3.10.10)。我建议更新到最新版本(截至本文 - 4.4.1 稳定版):

> npm install -g npm

或者如果上述方法失败:

> npm update -g npm

如果还是有问题,可以试试:

> npm config set ca ""

或者(我不鼓励但至少应该确认问题):

> npm config set strict-ssl false

作为旁注,您发布的大部分信息都是无关紧要的。主要问题出现在输出的末尾附近。您似乎遇到了 SSL 问题。

21 http request GET https://registry.npmjs.org/express-generator
22 info retry will retry, error on last attempt: Error: write EPROTO 101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20
22 info retry 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

参见:receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm

关于javascript - 在 Windows 10 机器上安装 Node 模块的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42728131/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com