javascript - module.js 474 throw err - Stack Overflow

I just installed the nodejs in my laptop and Im not sure how to run a js file in the node. I tried the

I just installed the nodejs in my laptop and Im not sure how to run a js file in the node. I tried the following mand, node C:\Program Files\nodejs\file.js but it shows this error

module.js:474 throw err 

Anyone has any idea? Im totally a newbie.

I just installed the nodejs in my laptop and Im not sure how to run a js file in the node. I tried the following mand, node C:\Program Files\nodejs\file.js but it shows this error

module.js:474 throw err 

Anyone has any idea? Im totally a newbie.

Share Improve this question asked Nov 25, 2016 at 15:38 Muhammad UsmanMuhammad Usman 1151 gold badge2 silver badges11 bronze badges 1
  • In my case, the problem was that the working directory of the shortcut file that I run node from was the node directory. I removed it so that Windows uses the current directory as the working directory and that fixed it. – Synetech Commented May 14, 2018 at 2:00
Add a ment  | 

1 Answer 1

Reset to default 5

you have to install node modules first.

cd C:\Program Files\nodejs\
npm install
node file.js

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744007058a4542539.html

相关推荐

  • javascript - module.js 474 throw err - Stack Overflow

    I just installed the nodejs in my laptop and Im not sure how to run a js file in the node. I tried the

    9天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信