原来,最新express4.0版本中将命令工具分家出来了(项目地址:https://github.com/expressjs/generator),所以我们还需要安装一个命令工具,命令如下:

安装express命令:npm install -g express

然后再安装:npm install -g express-generator  

就不会提示命令行无此命令了。。

 

1.创建工程  express helloWorld(老版本的experss -t ejs helloWorld)   默认是jade模式

      创建ejs模式html   express ejs helloWorld(习惯性应用的)

2.进入工程  cd helloWorld 

3.加入依赖 -- 命令:npm install

4.启动项目 -- 命令:npm start(不是老版本的node app.js)!!!

 

相关文章:

  • 2021-11-14
  • 2021-12-17
  • 2022-12-23
  • 2022-01-13
  • 2021-12-10
  • 2021-04-28
  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-01-03
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案