你瞅啥呢
摘要: 2024-03-06 Invalid schematic "entity". Please, ensure that "entity" exists in this collection.==》你应该使用了不正确的命令 这个问题,其实就是文心一言误导了我,它告诉我创建实体类的命令为: nest g entity 你的实体类名称 但实际上,创建实体类应该用class,而不是entity。 所以,解决方案为更正命令,正确命令为: nest g class 你的实体类名称 但是,但是!上面这个命令不会生成entity,你 阅读全文
posted @ 2024-03-06 17:59 叶乘风 阅读(85) 评论(0) 推荐(0)
摘要: 2024-03-06 记录express、koa、nest等三个node框架的区别 三者皆是用于构建Web应用程序的Node.js框架。 Express: 设计:Express是一个基于回调函数的Web框架,它使用中间件模式来处理请求和响应。它提供了许多内置的中间件,如路由、模板引擎等,并且可以与第三方中间件集成。 功能:Express具有简单、灵活和可扩展的特点。它提供了丰富的A 阅读全文
posted @ 2024-03-06 17:22 叶乘风 阅读(874) 评论(0) 推荐(0)
摘要: 2024-03-06 Module '"@nestjs/platform-express"' has no exported member 'ExpressModule'.找不到ExpressModule这个模块 问题描述:nestjs后端开发,遇到跨域问题,打算用express来配合处理,结果引入express的一个模块失败。 app.modules.ts import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; imp 阅读全文
posted @ 2024-03-06 11:32 叶乘风 阅读(105) 评论(0) 推荐(0)
摘要: 2024-03-06 NestJs学习日志之跨域 新建一个跨域中间件(如:cors.middleware.ts),并把它导入到项目根目录的app.modules.ts里面使用。 中间件代码如下: import { Injectable, NestMiddleware } from "@nestjs/common"; @Injectable() // 阅读全文
posted @ 2024-03-06 11:27 叶乘风 阅读(145) 评论(0) 推荐(0)
摘要: 2024-03-06 NestJs学习日志之新建nest项目,运行启动命令nest start报错:Could not find TypeScript configuration file "tsconfig.json". ==》你应该在nest项目里面运行启动命令,而不是其他的目录 如题,低级错误。具体报错: Could not find TypeScript configuration file "tsconfig.json". Please, ensure that you are running this command in the appropriate direct 阅读全文
posted @ 2024-03-06 10:19 叶乘风 阅读(286) 评论(0) 推荐(0)