nodejs module.js:340 error: cannot find module

前端 未结 21 576
别那么骄傲
别那么骄傲 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 06:55

    I was having the same problem with a server someone had written a while back. It turns out I didn't have a few things installed that the script required.

    This question was helpful to me.

    I ended up being able to use:

    npm install yourMissingDependency 
    

    Although in your instance it may just be a file that it doesn't have a path to. You could try putting that file in the same folder you are running the node script from.

提交回复
热议问题