No repository for "Article" was found. Looks like this entity is not registered in current "default" connection? +2ms
RepositoryNotFoundError: No repository for "Article" was found. Looks like this entity is not registered in current "default" connection?

首先檢查了 user.entity.ts 文件是存在,此時文件存在仍然報錯,猜測是數據庫加載時序問題
因為在報錯之前,做了移動 database 文件夾到 service 文件夾的操作


import 的路徑也隨之修改了,按理說是不應該報錯的。
嘗試把 database 移回原位 src 下

同時修改了 import 路徑

重新 yarn start 后運行正常了
再次嘗試移動 database 文件到根目錄下,此時與 app.module.ts 同級

運行又報錯
所以是加載某個文件的路徑出問題了,才造成報錯
打開 database.providers.ts 修改 entities 路徑
原來配置的路徑

修改后

entity 文件放到統一的文件夾里管理了
