CentOS 安装 bower

Bower是一个客户端技术的软件包管理器,它可用于搜索、安装和卸载如JavaScript、HTML、CSS之类的网络资源。 
其他还有一些建立在Bower基础之上的开发工具,如YeoMan和Grunt

安装bower前,需要先安装 nodejs 和 npm 。

# yum install nodejs

# yum install npm

然后通过npm 安装bower,但是在安装的过程中报错

#npm install -g bower

 

npm ERR! Error: CERT_UNTRUSTED
npm ERR!     at SecurePair. (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 2.6.32-696.1.1.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /yjdata/www/fastadmin
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!     /yjdata/www/fastadmin/npm-debug.log
npm ERR! not ok code 0

解决:

ssl验证问题,使用下面的命令取消ssl验证即可解决
# npm config set strict-ssl false

或者:npm config set registry=”http://registry.npmjs.org/”

然后再执行:npm install -g bower

安装成功

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注