小二班一番厮杀:那英四强诞生:大家闺秀,小家碧玉,窈窕淑女,妍姿俊俏 。不解释!?不行!陈冰,李嘉格,刘明湘,张碧晨。大多数的时候,只要脸好看,一切都那么自热而然的顺理成章。虽然网上骂声四起,黑压压一片,总有那么一片不满。忆往昔,快女十强美女寥寥无几,众人云云,不也发出过中性一片,大扫雅兴。
迎合往往活的心力憔悴,从第一届的梁博,张玮,多亮,张赫宣。次奥,我居然还记得,红果果四个汉子,只能佐证那英也喜欢汉子。
昨晚我仍旧没能装上node,因为报错
Traceback (most recent call last): File "../../tools/js2c.py", line 36, in <module> import bz2 ImportError: No module named bz2 make[1]: *** [/home/softs/node-v0.8.12/out/Release/obj/gen/libraries.cc] Error 1 make[1]: Leaving directory `/home/softs/node-v0.8.12/out' make: *** [node] Error 2
一番折腾,原来装Python的时候,忘记装了bz2
yum -y install bzip2* cd /usr/local/src/Python-2.7.5/Modules/zlib ./configure ; make; make install cd /usr/local/src/Python-2.7.5
python setup.py install
然后回到/usr/local/src/node-v0.10.24
cd /usr/local/src/node-v0.10.24 make make install node -v v0.10.24
node安装成功。
参考: http://flyer2010.iteye.com/blog/1699946
http://hxl2009.blog.51cto.com/779549/1031320
http://blog.csdn.net/liubo2012/article/details/8367603
npm -v 1.3.21
可见node包管理器npm也安装好了。
node > console.log("hello Nodejs "); hello Nodejs
测试成功
接着安装express框架
npm install express -g
[email protected] /usr/local/lib/node_modules/express ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected])
突然想起我熟悉3的框架,当前装了最新版4,于是卸载
npm uninstall express
重新装 指定版本
npm install [email protected]* -g
[email protected] /usr/local/lib/node_modules/express ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
express -V 3.5.3
express3安装成功,
基于该框架建立node平台的web,
进入之前挂载的目录,新建目录web mkdir web 建立node express web express MioApp
create : MioApp create : MioApp/package.json create : MioApp/app.js create : MioApp/public create : MioApp/public/javascripts create : MioApp/public/images create : MioApp/public/stylesheets create : MioApp/public/stylesheets/style.css create : MioApp/routes create : MioApp/routes/index.js create : MioApp/routes/user.js create : MioApp/views create : MioApp/views/layout.jade create : MioApp/views/index.jade install dependencies: $ cd MioApp && npm install run the app: $ node app
执行上述目录已经在当前目录建立了一个MioApp网站 然后进入MioApp目录 cd MioApp 执行 npm install 加载各种依赖包
[email protected] node_modules/express ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) [email protected] node_modules/jade ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── monoc[email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected], [email protected])
加载依赖成功,
启动node服务器
node app
网站开始监听3000端口 Express server listening on port 3000
输入网址,可打开网页
后台监听到
GET / 200 303ms - 170b GET /stylesheets/style.css 200 7ms - 110b
部分资料:http://zhaohe162.blog.163.com/blog/static/38216797201402234212981/
http://www.cnblogs.com/seanlv/archive/2011/11/22/2258716.html
http://www.lifeba.org/arch/nodejs_npm_express.html
http://blog.fens.me/nodejs-express3/