Step 一、確認服務器有nodejs編譯及依賴相關軟件,若是沒有可經過運行如下命令安裝。node
[root@BobServerStation local]# yum -y install gcc gcc-c++ openssl-develc++
[root@BobServerStation local]# wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gzexpress
[root@BobServerStation node-v0.10.24]# ./configure --prefix=/usr/local/nodenpm
[root@BobServerStation node-v0.10.24]# vim /etc/profilevim
[root@BobServerStation node-v0.10.24]# node -v瀏覽器
v0.10.24服務器
[root@BobServerStation node-v0.10.24]# nodeapp
> console.log(」Hello NodeJS, I'm Bob.Z「);框架
Hello NodeJS, I'm Bob.Z測試
undefined
>
[root@BobServerStation local]# npm install express -g
[root@BobServerStation local]# express DemoApp
[root@BobServerStation local]# cd DemoApp
[root@BobServerStation DemoApp]#
[root@BobServerStation local]# cd DemoApp
[root@BobServerStation DemoApp]# npm install
[root@BobServerStation DemoApp]# node app
Express server listening on port 3000
Welcome to Express