Node.js Error: Cannot find module express

前端 未结 15 1494
情话喂你
情话喂你 2020-12-22 18:56

I wrote my first node.js app, but it can\'t find express library:

C:\\ChatServer\\Server>node server.js

module.js:340
    throw err;
          ^
Error: C         


        
15条回答
  •  南方客
    南方客 (楼主)
    2020-12-22 19:08

    Check if you are not install express module, use this command:

     npm install express
    

    and if your node_modules directory is in another place, set NODE_PATH envirnment variable:

     set NODE_PATH=your\directory\to\node_modules;%NODE_PATH%
    

提交回复
热议问题