nodejs module.js:340 error: cannot find module

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

    Try typing this into the Node command-line environment:

    .load c:/users/laura/desktop/nodeTest.js.

    It should work for what you're trying to do.

    If you want to call the file directly, you'd have to have it in the root directory where your Node installation resides.

提交回复
热议问题