javascript - I am getting a error in node js which is of Require Stack - Stack Overflow

Getting this error in nodejs while trying to open .js file{code: 'MODULE_NOT_FOUND',requir

Getting this error in nodejs while trying to open .js file

{ code: 'MODULE_NOT_FOUND', requireStack: }

Don't know what's causing this Reinstalled node js along with it's packages and removed nodejs modules and added them again but still no success Found solutions on some websites(including stackoverflow) but none of them seems to work

Getting this error in nodejs while trying to open .js file

{ code: 'MODULE_NOT_FOUND', requireStack: }

Don't know what's causing this Reinstalled node js along with it's packages and removed nodejs modules and added them again but still no success Found solutions on some websites(including stackoverflow) but none of them seems to work

Share Improve this question asked Jan 18, 2022 at 11:18 Ayush KumarAyush Kumar 111 gold badge1 silver badge2 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

This question requires more context, but here's how to think about solving the question. Whenever you have a 'MODULE_NOT_FOUND' error, the culprit is almost always your package.json file.

Whatever code you're implementing in your .js depends on an npm module/package that is referenced in package.json, but (possibly) hasn't been installed (ie, there's no corresponding node_modules folder for the problem.

It's a bit odd that the require stack is empty, as that would have given us some insight into the problem.

Consider doing as I've described:

  • Review the error and see if you can find anything in the require stack pointing to the issue.
  • Check your package.json for all installed packages
  • To be doubly sure, re-run npm install
  • Make sure your JS file is in the same directory as the package.json file

Let me know how this goes!

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

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

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

关注微信