无法在 Linux 中安装 Bower

Can't install bower in Linux

我尝试安装 bower。

我用LinuxMint 17.2 Rafaela

我有节点 v0.10.25 和 npm 1.3.10

我尝试在终端中 运行:

 sudo npm install -g bower

并得到:

npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm ERR! Error: CERT_UNTRUSTED
npm ERR!     at SecurePair.<anonymous> (tls.js:1370:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR!     at CleartextStream.Readable.read 
(_stream_readable.js:320:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR!     at doWrite (_stream_writable.js:223:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:213:5)
npm ERR!     at EncryptedStream.Writable.write 
(_stream_writable.js:180:11)
npm ERR!     at write (_stream_readable.js:583: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.4.0-109-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" 
"bower"
npm ERR! cwd /
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /npm-debug.log
npm ERR! not ok code 0

如何解决?

首先,节点 v0.10.25 真的很旧(2014 年 1 月 23 日)。还有 npm 1.3.10 ...请将 node/npm 更新到更新的版本(节点:8 或 10,npm:5.6):

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

其次:如报错信息所述,是证书错误。可能是版本过时的原因...