一、安装npm
安装node主要是为了使用npm命令,也可以单独安装npm。
安装node可查看如下文章https://blog.csdn.net/huangbaokang/article/details/81092247
二、安装bower
npm install -g bower
三、安装jquery插件
使用bower install jquery命令即可,如果报了如下错,根据提示加上–allow-root参数即可。
[root@localhost hbk]# bower install jquery
bower ESUDO Cannot be run with sudo
Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.
http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814
You can however run a command with sudo using "--allow-root" option
如果没有git,可以使用yum install git
安装