Can't install bower in Linux

时间:2018-05-28 18:40:37

标签: linux bower linuxmint bower-install

I try to install bower.

I use Linux Mint 17.2 Rafaela

I have node v0.10.25 and npm 1.3.10

I try to run in the terminal:

 sudo npm install -g bower

and get:

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

How to fix it?

1 个答案:

答案 0 :(得分: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

第二:正如错误消息所示,这是一个证书错误。迁移的原因是过时的版本......