nodejs module.js:340 error: cannot find module

前端 未结 21 632
别那么骄傲
别那么骄傲 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:13

    You need to:

    • Remove the tick of Hide extensions for known file types from Windows Explorer folders option
    • Your file will appear as testNode.js.txt
    • Remove the trailing .txt so as the file to be resolved as JS file

    That's it, now it works!

提交回复
热议问题