npm 安装module

1.

安装完node  npm

2 安装 express

npm install -g express-generator  
-g flag means that you are installing express globally on your system.

3.创建一个express应用

express -c stylus express_example 
-c states that we want to use stylus for css. You should see the following output:

输出日志:

    create : express_example  
    create : express_example/package.json  
    create : express_example/app.js  
    create : express_example/public  
    create : express_example/public/javascripts  
    create : express_example/public/images  
    create : express_example/public/stylesheets  
    create : express_example/public/stylesheets/style.styl  
    create : express_example/routes  
    create : express_example/routes/index.js  
    create : express_example/routes/user.js  
    create : express_example/views  
    create : express_example/views/layout.jade  
    create : express_example/views/index.jade  
      
    install dependencies:  
     $ cd express_example && npm install  
      
    run the app:  
     $ node app  

4. 安装常用module

cd express_example && npm install


5.执行

node app.js  


6.安装其他modules

npm install querystring --save

npm install restify --save
npm install mongoose --save







你可能感兴趣的:(NodeJs)