module.js:338 throw err in node.js

前端 未结 6 551
陌清茗
陌清茗 2021-02-08 01:31

I\'m using ubuntu and I\'m trying to run a script using nodejs and i\'m getting this error.

/home/bebz/Documents/test# node server.js
module.js:338
throw err;
           


        
6条回答
  •  难免孤独
    2021-02-08 02:06

    This error occurs when module name and file name does not match. It's resolved after using the same name for module and file name. e.g.

    module - Hello,
    File name - Hello.js
    

提交回复
热议问题