user root
install express
npm install express -g
install express...
npm install express-generator -g
Create express project
express <project_name>
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 asnpm 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.start peoject
express start
- 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!!!