node.js& mongodb:nocaughtexception:一旦编译

发布于 2025-01-31 05:26:24 字数 313 浏览 2 评论 0原文

我有此导入

const User = require("./Usermodel")'

,我想将其更改为

const User = require("./UserModel")

尝试更改导入键的何时,以与我的其他导入和实际导入的实际模块名称保持一致。我不断遇到错误:

uncaughtException: Cannot overwrite `User` model once compiled.

我该怎么做才能改变这一点?

I have this import

const User = require("./Usermodel")'

and I want to change it to

const User = require("./UserModel")

When I try to change the import-spelling, to be consistant with my other imports and the actual module-name I'm importing. I keep getting the error:

uncaughtException: Cannot overwrite `User` model once compiled.

What can I do to change this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

层林尽染 2025-02-07 05:26:24

问题是我在不同的文件中有相同的导入。每个人的拼写必须相同。

The problem was that I had the same import in different files. The spelling must be the same in each of them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文