2024-03-06 Invalid schematic "entity". Please, ensure that "entity" exists in this collection.==》你应该使用了不正确的命令

这个问题,其实就是文心一言误导了我,它告诉我创建实体类的命令为:

nest g entity 你的实体类名称

但实际上,创建实体类应该用class,而不是entity。

所以,解决方案为更正命令,正确命令为:

nest g class 你的实体类名称

 但是,但是!上面这个命令不会生成entity,你应该使用一下命令来创建:

nest g resource user

该命令会给user这个资源生成控制器类和服务类

最后:其实entity可以通过手动创建..., 比如你直接新建一个文件user.entity.ts。

posted @ 2024-03-06 17:59  叶乘风  阅读(23)  评论(0编辑  收藏  举报