【发布时间】:2021-09-16 14:26:33
【问题描述】:
问题:如何解决 Typescript 编译器 (tsc) 错误“命名空间 'NodeJS' 没有导出的成员 'Global'”?
在运行 tsc 时,我突然在“遗留”(非新)项目中看到以下错误:
node_modules/expect/node_modules/@jest/types/build/Global.d.ts:85:62 - error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
85 export interface Global extends GlobalAdditions, Omit<NodeJS.Global, keyof GlobalAdditions> {
~~~~~~
我尝试添加安装@types/node 并将"types": ["node"] 添加到我的tsconfig(如this SO post 中的建议),但这没有帮助。
节点版本:12.18.4
笑话版:26.5.3
【问题讨论】:
标签: javascript node.js jestjs tsc