[英]how to fix "Error: Cannot find module './src/bot/index'"
When I write node src/index.js当我写 node src/index.js
I take this error Error: Cannot find module './src/bot/index' Require stack: C:\Users\MIMAR\Desktop\EJS\src\index.js
我收到这个错误Error: Cannot find module './src/bot/index' Require stack: C:\Users\MIMAR\Desktop\EJS\src\index.js
Why I get this error?为什么我会收到此错误?
src/index.js源代码/index.js
https://paste.ee/p/UjnbR https://paste.ee/p/UjnbR
Please help i tried everything请帮助我尝试了一切
rebuild nodejs重建节点
rebuild all modules重建所有模块
node src/index.js executes the index inside the src dir, since you are trying to import './src/bot/index' it means that your structure should look like src>src>bot>index.js, which I doubt so, try changing it to import "./bot/index"节点 src/index.js 在 src 目录中执行索引,因为您正在尝试导入 './src/bot/index' 这意味着您的结构应该看起来像 src>src>bot>index.js,我对此表示怀疑所以,尝试将其更改为导入“./bot/index”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.