nodejs module.js:340 error: cannot find module

前端 未结 21 574
别那么骄傲
别那么骄傲 2021-02-02 06:39

I installed nodejs in C:\\Program Files (x86)\\nodejs

then I created a .js file and saved it in my desktop just to output \'hello world\' in the console:



        
21条回答
  •  别跟我提以往
    2021-02-02 07:09

    1. Try npm start in Node.js Command Prompt.
    2. Look at the end of the messages - it gives you the path of log file in "Additional Logging Details ..." something like c:\users\MyUser\npm-debug.log
    3. Open this file in Notepad and find the real address of Node.exe : something like C:\\Program Files\\nodejs\\\\node.exe
    4. Try cd to this path
    5. Call node.exe +

      Server is listening on port 1337 !
      

提交回复
热议问题