系统相关
首页 > 系统相关> > linux – 如何在centos 7上安装bower

linux – 如何在centos 7上安装bower

作者:互联网

我在安装nodejs后尝试在centos7上安装bower.要安装nodejs,我按照以下步骤操作

第1步:wget http://nodejs.org/dist/v0.10.30/node-v0.10.30.tar.gz

第2步:tar xzvf node-v *&& cd node-v *

Step3:sudo yum安装gcc gcc-c

Step4:./ configure

第五步:制作

Step6:sudo make install

Step7:node –version

我已成功安装了nodejs,我从Install Nodejs开始执行此步骤

然后通过运行命令sudo yum install npm安装npm.

现在我正在尝试安装bower所以我运行以下命令
npm install -g bower.但是得到以下错误.请告诉我如何正确安装凉亭.

[neelabh@localhost node-v0.12.7]$npm install -g bower
npm ERR! tar.unpack untar error /home/neelabh/.npm/bower/1.4.1/package.tgz
npm ERR! Linux 3.10.0-123.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /usr/local/lib/node_modules/bower
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/bower'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/bower']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/bower',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/bower',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR!      '/usr/local/lib/node_modules/npm/node_modules

/mkdirp/index.js:47:53′ ,
    错误的ERR! ‘FSReqWrap.oncomplete(fs.js:95:15)’]}
    错误的ERR!
    错误的ERR!请尝试以root / Administrator身份再次运行此命令.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/neelabh/Downloads/Softwares/node-v0.12.7/npm-debug.log

解决方法:

尝试:

sudo yum update -y

sudo yum install -y epel-release gcc gcc-c++ git libtool-ll libtool-ltdl-devel lsof make unixODBC unixODBC-devel wget

sudo yum install -y nodejs npm --enablerepo=epel

sudo npm install -g node-gyp bower

检查您的互联网连接(您是否在代理服务器下?).它可能需要额外的步骤来解决互联网问题.

标签:linux,node-js,npm,bower,bower-install
来源: https://codeday.me/bug/20190824/1709196.html