Node.JS в Centos 6 + bower, angular.js, bootstrap, express
# yum install -y git
=========================================
# curl -sL https://rpm.nodesource.com/setup | bash -
# yum install -y nodejs npm
# node --version
v0.10.32
# npm --version
1.4.28
=========================================
// устанавливаю глобально менеджер пакетов bower
# npm install -g bower
# bower --version
1.3.12
// устанавливаю глобально nodemon
# npm install -g nodemon
=========================================
# mkdir -p /projects/myproject
# useradd developer
# chown -R developer /projects
# su - developer
// Определяю куда bower будет копировать пакеты по умолчанию.
$ vi ~/.bowerrc
{
"directory": "public/lib"
}
$ cd /projects/myproject/
$ vi package.json
{
"name": "nodejs_project",
"description": "node.js project description",
"author": "marley "
}
// express.js
$ npm install express --save
или явно задать
$ vi package.json
{
"name": "nodejs_project",
"description": "node.js project description",
"author": "marley ",
"dependencies": {
"express": "3.x"
}
}
$ npm install
$ cd node_modules/express/bin/
$ ./express --version
3.18.6
=======================================
// angular.js
$ bower install angular
// twitter bootstrap
$ bower install bootstrap
$ mkdir public/views
$ mkdir public/src
=======================
$ vi server.js
$ vi public/main.html
С сайта bootswatch.com копирую Flatly theme
http://bootswatch.com/flatly/bootstrap.min.css
$ cd public/src/
$ wget bootswatch.com/flatly/bootstrap.min.cs
$ nodemon server.js
=========================================================