[英]I am getting a error in node js which is of Require Stack
Getting this error in nodejs while trying to open.js file尝试打开.js 文件时在 nodejs 中出现此错误
{ code: 'MODULE_NOT_FOUND', requireStack: } { 代码:'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不知道是什么原因重新安装了node js及其软件包并删除了nodejs模块并再次添加了它们但仍然没有成功在某些网站(包括stackoverflow)上找到了解决方案,但它们似乎都不起作用
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.
每当您遇到“MODULE_NOT_FOUND”错误时,罪魁祸首几乎总是您的 package.json 文件。
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.无论您在
.js
中实现什么代码,都取决于 package.json 中引用的 npm 模块/包,但(可能)没有安装相应的node_modules
文件夹
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:考虑按照我的描述进行:
npm install
npm install
Let me know how this goes!让我知道这是怎么回事!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.