admin 管理员组文章数量: 1086019
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
1 Answer
Reset to default 5you have to install node modules first.
cd C:\Program Files\nodejs\
npm install
node file.js
本文标签: javascriptmodulejs 474 throw errStack Overflow
版权声明:本文标题:javascript - module.js 474 throw err - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744007059a2517480.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论