1、通过以下命令建立网站基本结构:
<span style="margin: 0px; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21.6000003814697px;"><span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255);">express -e microblog</span></span>
当前目录下出现了子目录microblog,并且产生了一些文件:
create : microblog
create : microblog/package.json
create : microblog/app.js
create : microblog/public
create : microblog/public/javascripts
create : microblog/public/images
create : microblog/public/stylesheets
create : microblog/public/stylesheets/style.css
create : microblog/views
create : microblog/views/index.jade
create : microblog/views/layout.jade
create : microblog/views/error.jade
create : microblog/routes
create : microblog/routes/index.js
create : microblog/routes/users.js
create : microblog/bin
create : microblog/bin/www
install dependencies:
$ cd microblog && npm install
run the app:
$ DEBUG=microblog:* ./bin/www
无参数的npm install 的功能就是检查当前目录下的package.json,并自动安装所有的指定的依赖。
来源:CSDN
作者:laijieyao
链接:https://blog.csdn.net/laijieyao/article/details/44338457