首页 > 解决方案 > 承诺方法后缺少属性

问题描述

我在使用 .get 和 .set Redis 方法时遇到问题。

const getAsync: Promise<string> = promisify(client.get).bind(client)
const setAsync: Promise<void> = promisify(client.set).bind(client)

这给出了以下错误:

Type '(arg1: string) => Promise<string | null>' is missing the following properties from type 'Promise<string>': then, catch, finally, [Symbol.toStringTag]ts(2739)

我应该怎么做?

标签: typescriptpromisenode-redis

解决方案


推荐阅读