wenqiyun / nest-admin

采用nestjs typeorm vue开发的一套权限管理系统
MIT License
586 stars 100 forks source link

运行不起来 去掉 redis.util.ts 可以跑起来 #1

Closed mingzhi1 closed 3 years ago

mingzhi1 commented 4 years ago

运行不起来 去掉 redis.util.ts 可以跑起来 报错如下

 src/common/utils/redis.util.ts:83:45 - error TS2769: No overload matches this call.
   Overload 1 of 6, '(key: KeyType, data: Map<string, ValueType> | ValueType[] | { [key: string]: ValueType; }): Promise<"OK">', gave the following error.
     Argument of type 'object | Map<string, string>' is not assignable to parameter of type 'Map<string, ValueType> | ValueType[] | { [key: string]: ValueType; }'.
       Type 'object' is not assignable to type 'Map<string, ValueType> | ValueType[] | { [key: string]: ValueType; }'.
         Type 'object' is not assignable to type '{ [key: string]: ValueType; }'.
           Index signature is missing in type '{}'.
   Overload 2 of 6, '(key: KeyType, ...args: ValueType[]): Promise<"OK">', gave the following error.
     Argument of type 'object | Map<string, string>' is not assignable to parameter of type 'ValueType'.
       Type 'object' is not assignable to type 'ValueType'.
         Type '{}' is missing the following properties from type 'Buffer': write, toJSON, equals, compare, and 78 more.

 83         return await this.client.hmset(key, data)
wenqiyun commented 4 years ago

@mingzhi1 已修复问题,产生原因,本项目创建时间较早,之后对依赖升级了一次 typescript 导致报错,之后会修复项目中大多类型警告

iravmi commented 4 years ago

项目启动了,但是调用API时报错。

(node:867) UnhandledPromiseRejectionWarning: TypeError: layout is not a function at /Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/appenders/console.js:6:16 at /Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/log4js.js:42:5 at Array.forEach () at sendLogEventToAppender (/Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/log4js.js:41:21) at /Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/clustering.js:23:26 at Array.forEach () at sendToListeners (/Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/clustering.js:23:13) at Object.send (/Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/clustering.js:89:7) at Logger._log (/Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/logger.js:90:16) at Logger.log (/Users/pitt/nestapp/admin/servers/node_modules/log4js/lib/logger.js:73:12) (node:867) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)

wenqiyun commented 4 years ago

@iravmi 加的log4js 报错,解决方式 可以先去掉log4js 相关,等之后的更新