nodejs express project

user root

  1. install express
    npm install express -g

  2. install express...
    npm install express-generator -g

  3. Create express project
    express <project_name>

  4. Enter project files and install dependency
    cd <project_name>
    npm install
    Maybe the dependency is not all round. So you need install the others yourself.
    But if there is a warning as
    npm WARN deprecated jade@0.26.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
    Just ignore it.

  5. start peoject
    express start

  6. done
    terminal viewer:

\> myweb@0.0.0 start /home/pualus/Documents/web/node/myweb
\> node ./bin/www
GET / 200 315.817 ms - 170
GET /stylesheets/style.css 200 6.160 ms - 111
GET /favicon.ico 404 35.503 ms - 1185
GET /favicon.ico 404 34.215 ms - 1185

Open the firefox then input site:localhost:3000/
OK!!!

posted @ 2017-05-16 09:49  屋中人  阅读(296)  评论(0编辑  收藏  举报
返回顶部