WebGL2RenderingContext尝试使用tsc file.ts运行Typescript时出错

问题描述 投票:0回答:1

[我刚刚在Windows 10计算机上同时使用npm和yarn安装了Typescript,并且在运行'tsc file.ts'时出现错误,提示'582声明var WebGL2RenderingContext'。

它指向目录../../AppData/Roaming/npm/node_modules/typescript/lib/lib.dom.d.ts:16485:13

[此外,它说16485声明var WebGL2RenderingContext:{这里也声明了'WebGL2RendingContext'。发现1个错误。

这是Node.js命令提示符中的快照

enter image description here

javascript typescript npm yarn
1个回答
0
投票

感谢Zydnar,没有Zydnar的帮助,我无法解决这个问题。经过深思熟虑,我决定注释掉WebGL2渲染功能,并且它起作用了,将其转换为javascript,最终我使用ts-node filename.ts运行代码。

再次感谢@Zydnar,您非常有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.