
nestjs
nestjs
Cloud Flower
二次元老贼、U3D游戏开发、NestJS学习中
展开
-
nestjs:production环境下nest build提示Cannot find name ‘process‘
将package.json中 @types/node从devdependencies移至dependencies。有可能也有其他提示一些类没有找到,需要将对应的@types/xxx迁移。找不到node下的一些变量。原创 2023-08-27 21:21:03 · 313 阅读 · 0 评论 -
nestjs: sharp_1.default is not a funciton
使用import {sharp} from 'sharp',导入的是命名空间。使用import来使用sharp时,得用。原创 2023-08-19 13:34:19 · 370 阅读 · 0 评论 -
nestjs:NET::ERR_CERT_AUTHORITY_INVALID
核心原因,证书不可信,换成可信证书。原创 2023-07-22 21:06:34 · 389 阅读 · 0 评论 -
nestjs:使用typeorm在启动应用提示Duplicate key name ‘IDX_d87a44fac9965cb7cf94cba11c‘
可能是@Column({ unique: true })与@Index()联合使用导致,删除掉@Index()能够正常运行。按照理论,唯一约束会自动创建唯一索引,@Column({ unique: true })可能已经创建了唯一索引,暂时未进行证明。原创 2023-07-20 15:47:45 · 295 阅读 · 0 评论 -
nestjs:创建唯一键报错 QueryFailedError: Duplicate key name ‘IDX_d87a44fac9965cb7cf94cba11c‘
创建唯一约束时会创建唯一索引,所以应该把@Index()去掉。原创 2023-06-07 15:35:52 · 250 阅读 · 0 评论 -
nestjs:判断字符串是否是邮箱格式
【代码】nestjs:判断字符串是否是邮箱格式。原创 2023-06-06 21:16:27 · 119 阅读 · 0 评论 -
nestjs:query params使用validator-class提示type must be a number conforming to the specified constraints
query的参数默认都是string类型的,需要进行转换。原创 2023-06-06 20:22:57 · 696 阅读 · 0 评论 -
nestjs:使用nodemailer发送邮件提示mailer Error: Unexpected socket close
如果端口用的465,需要加上 secure: true。之前没加导致上述报错。原创 2023-06-05 18:35:02 · 492 阅读 · 0 评论 -
nestjs:163邮箱smtp的发件人无法更改
需要在163邮箱里设置发件人信息,nestjs的from修改name无效。原创 2023-06-05 15:46:28 · 217 阅读 · 0 评论 -
使用163的SMTP服务发邮件
kettle使用中出现的问题。原创 2023-06-05 11:35:53 · 358 阅读 · 0 评论 -
Pentaho Data Integration:执行job提示 无法找到作业的开始点
找到Pentaho Data Integration (Base Install)下载。如下图,选择 发送邮件。无法找到作业的开始点。原创 2023-06-05 11:30:07 · 748 阅读 · 0 评论 -
nestjs:No metadata for “Concern“ was found.
检查是否加上了@Entity。原创 2023-05-22 18:35:56 · 341 阅读 · 0 评论 -
nestjs: Object.create,不会复制已有的数据
与Object.assign不同,已有的数据是以原型存在,如果将数据传回给客户端,则原型里的数据不会反回。原创 2023-05-17 18:47:05 · 74 阅读 · 0 评论 -
nestjs:对query参数使用validation装饰器会报错
目前看到只对post的body有效,query参数需要一个一个的处理,暂时没想到好的办法。原创 2023-05-17 16:49:18 · 258 阅读 · 0 评论 -
nestjs:定义字典类型
下面的id可以改为任何命名。原创 2022-11-27 19:20:12 · 200 阅读 · 0 评论 -
nestjs:typeorm out of range value for column
【代码】nestjs:typeorm out of range value for column。原创 2022-11-27 19:18:06 · 197 阅读 · 0 评论 -
nestjs:typeorm使用无符号整数
参考:原创 2022-11-27 19:11:34 · 158 阅读 · 0 评论 -
nestjs:typeorm data too long for column ‘content‘ at row 1
将类型设置为longtext。原创 2022-11-27 19:10:18 · 293 阅读 · 0 评论 -
nestjs:typeorm Cannot read property ‘retryAttempts‘ of undefined on nestjs typeorm
TypeOrmModule.forRootAsync没有传入配置。原创 2022-11-27 17:39:45 · 286 阅读 · 0 评论 -
nestjs:typeorm Field ‘id‘ doesn‘t have a default value
可以将主键首项设置为PrimaryGeneratedColumn。主键中首项必须有默认值。原创 2022-11-27 17:36:25 · 505 阅读 · 0 评论 -
nestjs:改变debug端口
多个项目,如果不改调试端口,会出现无法同时调试的情况。[port]不写默认为9229。原创 2022-11-27 17:17:45 · 513 阅读 · 0 评论 -
nestjs:typeorm对数据库中用驼峰命名字段转蛇形命名
【代码】nestjs:typeorm对数据库中用驼峰命名字段转蛇形命名。原创 2022-11-27 17:10:59 · 904 阅读 · 0 评论 -
nestjs知识系列:nest工程升级
也可以新建一个nest项目,将package.json覆盖,之后再npm i,缺什么依赖就添加对应的依赖。(可以略过,如果你不想更改全局)先npm install -g @nestjs/cli,升级脚手架。将需要升级的组件一个一个的用npm i --save(-dev)来手动加载,再解决依赖不匹配的问题。nest update或者nest update --force提示fail。我从nestjs7升到9,实际上无法一键升级。但是会提示升级那些组件。原创 2022-10-05 18:27:26 · 1526 阅读 · 0 评论 -
nest:[TypeOrmModule] Unable to connect to the database. Retrying
有可能是刚开机的时候,mysql服务还没有开启导致的。原创 2022-09-24 18:37:00 · 2624 阅读 · 1 评论 -
nestjs:index.ts的作用
当improt文件目录时,会自动寻找有没有index.ts,如果有则导入。原创 2022-09-03 21:38:13 · 260 阅读 · 0 评论 -
nestjs:Cannot read property ‘retryAttempts‘ of undefined
检查数据库的配置是否有问题。原创 2022-09-03 21:33:38 · 287 阅读 · 0 评论 -
webstorm用attach to 调试nestjs项目
用Attach模式的好处是,不用每次手动重启nestjs(用--watch运行时,检测到代码有修改会自动重启),之后再次Attach断点位置是对的。如果用别的方式来启动项目,可能在代码修改后,原先的断点的位置会错乱。在Webstorm的Terminal执行nest start --watch --debug=9229。执行debug按钮附加到对应程序。配置Attach需要的参数。原创 2022-09-03 15:41:57 · 1118 阅读 · 0 评论 -
nestjs知识系列:(0 , rxjs_1.lastValueFrom) is not a function
参考:postgresql - TypeError: rxjs_1.lastValueFrom is not a function - Stack Overflow解决方法:npm i rxjs@^7yarn add rxjs@^7pnpm i rxjs @^7原创 2022-04-04 00:39:07 · 841 阅读 · 0 评论 -
nestjs知识系列:todo项目demo介绍
说明:前端使用angular,服务器使用mysql数据库。包含注册,登陆,创建、修改、删除todo项项目相关:源码:后端:GitHub - bhaikaju/todo-api at Video11前端:https://github.com/bhaikaju/todo-frontend/tree/Video18对应教程:https://www.youtube.com/play...原创 2022-04-03 15:45:22 · 291 阅读 · 0 评论 -
nestjs:JwtStrategy requires a secret or key TypeError: JwtStrategy requires a secret or key
解决方法:将import { Strategy } from 'passport-jwt'改为import { Strategy } from 'passport-local'; 需要先安装依赖,执行命令npm ipassport-local --save原创 2022-02-04 18:09:44 · 2249 阅读 · 2 评论 -
nestjs:win10安装postgresql14失败解决方案
说明: 本人第一次使用postgresql,去官网下载的14(最新版)Download PostgreSQL,然后就悲催了,按照网上各种法子安装都会出现:"Failed to load sql modules into the database cluster"解决方案:放弃安装14了,我觉得是版本问题,换成旧版本10.19 创建了本地用户postgres,将其账户类型改为管理员 之后...原创 2022-02-04 17:52:49 · 1540 阅读 · 0 评论 -
nestjs知识系列:使用postman测试websocket
原文:Using WebSocket Requests | Postman Learning Centerwebsocket socket.emit、socket.on等api详解Using WebSocket Requests | Postman Learning Center 点击发送按钮完成发送,可看到发送消息和返回值...原创 2022-02-01 15:55:24 · 2080 阅读 · 0 评论 -
nestjs知识点:win7执行“npm ln @nestjs\common”,报错提示“源文本中存在无法识别的标记 ”
说明:如下图 博主在win10没有出现这个情况解决方案:npm ln '@nestjs\common' (参考:npm(cnpm) 安装报错:源文本中存在无法识别的标记)...原创 2022-01-24 16:41:01 · 668 阅读 · 0 评论 -
nestjs知识系列:ws-adapter.js error TS2304: Cannot find name ‘URL‘
说明: 在编译nest的tsconfig.json文件时报错,解决方法: 在lib处加入dom库原创 2022-01-22 18:15:48 · 896 阅读 · 0 评论