1. 安装Nodejs: 下载地址:http://nodejs.org
  2. 设置环境变量,例如我将nodejs装在D:/program文件夹下,则设以下为系统环境变量

    D:\Program\nodejs  

  3. 安装Express开发框架:

       npm install -g express       

       npm install -g express-generator      

      4. 新建项目

        如果是用ejs模板用以下命令:

        express -e ejs newsproject  

   如果是用jade模板用以下命令:

         express -j newsproject  

 

       按照提示进入项目目录,运行npm安装

 

      //进入项目目录  

       cd newsproject  

        //输入命令安装  

        npm install  

 

      5. 运行项目

     //项目目录下运行命令,newsproject为项目名

      SET DEBUG=newsproject:* & npm start

     6. 浏览器访问:http://127.0.0.1:3000/即可见nodejs站点页面,页面输出:Express

相关文章:

  • 2021-11-14
  • 2021-12-22
  • 2021-08-04
  • 2021-07-27
  • 2021-09-29
  • 2021-06-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-12-17
  • 2022-02-03
  • 2022-12-23
相关资源
相似解决方案