错误:UNABLE_TO_GET_ISSUER_CERT_LOCALLY-安装npm软件包

时间:2020-02-14 00:31:39

标签: amazon-web-services npm amazon-ec2 ssh npm-install

我对此有疑问

1创建一个AWS EC2实例,

2连接SSH和

使用npm命令安装3个软件包, 但是在第三步,我收到一条错误消息。

[ec2-user@ip-172-31-45-159 ~]$ sudo npm install -g forever
npm http GET https://registry.npmjs.org/forever
npm http GET https://registry.npmjs.org/forever
npm http GET https://registry.npmjs.org/forever   //during 3 lines takes a few minutes. also wonder why it takes time in this line
npm ERR! Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY   //errormessage
npm ERR!     at SecurePair.<anonymous> (tls.js:1430:32)
npm ERR!     at SecurePair.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:1029:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:521:13)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:341:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:418:25)
npm ERR!     at doWrite (_stream_writable.js:226:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:216:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR!     at write (_stream_readable.js:602:24)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 4.14.154-99.181.amzn1.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "forever"
npm ERR! cwd /home/ec2-user
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ec2-user/npm-debug.log
npm ERR! not ok code 0

我检查了其他npm软件包,但它们发送相同的错误。我认为问题与https://registry.npmjs.org有关。请帮助;(

P.S。目的是建立一个Web服务器AMI(建立网站的步骤之一)

P.S.2我发现其他人可以解决相同错误的2种方法,其中一种对安全性不利。但这是我个人的项目,关于安全性并不那么重要。所以我已经用过命令 'npm config setstrict-ssl = false'和 “ npm配置集注册表https://registry.npmjs.org/” 但是他们没有用,什么也没变。

0 个答案:

没有答案