【发布时间】:2022-08-14 22:16:03
【问题描述】:
我想在我的打字稿项目\"typescript\": \"^4.5.5\" 中使用ts-transformer-keys。然后我在打字稿package.json 中添加了这个依赖项:
\"ts-transformer-keys\": \"^0.4.3\",
并在tsconfig.json 中添加了这个配置,如下所示:
\"plugins\": [
{ \"transform\": \"ts-transformer-keys/transformer\" }
]
但是当我在当前项目中导入ts-transformer-keys 时:
import { keys } from \'ts-transformer-keys\';
显示错误:
Cannot find module \'ts-transformer-keys\'. Did you mean to set the \'moduleResolution\' option to \'node\', or to add aliases to the \'paths\' option?ts(2792)
为什么会这样?我应该怎么做才能解决这个问题?我已经运行了 yarn 命令。节点版本为16.13.2。
标签: typescript