最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - module.js 474 throw err - Stack Overflow

programmeradmin1浏览0评论

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
发布评论

评论列表(0)

  1. 暂无评论