【发布时间】:2019-03-21 15:29:40
【问题描述】:
当我运行tsc 时,它给了我这个错误输出:
../../../AppData/Roaming/npm/node_modules/typescript/lib/lib.dom.d.ts(15340,11): error TS2430: Interface 'WebGLRenderingContext' incorrectly extends interface 'WebGLRenderingContextBase'.
Types of property 'getExtension' are incompatible.
Type '{ (name: "ANGLE_instanced_arrays"): ANGLEInstancedArrays; (name: "EXT_blend_minmax"): EXTBlendMinMax; (name: "EXT_color_buffer_half_float"): EXTColorBufferHalfFloat; (name: "EXT_frag_depth"): EXTFragDepth; (name: "EXT_sRGB"): EXTsRGB; (name: "EXT_shader_texture_lod"): EXTShaderTextureLOD; (name: "EXT_texture_filter_...' is not assignable to type '{ (extensionName: "EXT_blend_minmax"): EXT_blend_minmax | null; (extensionName: "EXT_texture_filter_anisotropic"): EXT_texture_filter_anisotropic | null; (extensionName: "EXT_frag_depth"): EXT_frag_depth | null; (extensionName: "EXT_shader_texture_lod"): EXT_shader_texture_lod | null; (extensionName: "EXT_sRGB"): EX...'.
Types of parameters 'name' and 'extensionName' are incompatible.
Type '"OES_vertex_array_object"' is not assignable to type '"ANGLE_instanced_arrays"'.
我的tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"rootDir": "src",
"outDir": "dist",
"strict": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": true
},
"exclude": [
"node_modules",
"dist"
]
}
tsc 是版本Version 3.1.3。
这是我的package.json:
{
"name": "pupp-tf-test",
"version": "0.0.1",
"description": "Try to get environment set up to program using TypeScript, Puppeteer, and TensorFlow.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "xiaodeaux",
"license": "ISC",
"dependencies": {
"@tensorflow/tfjs-node-gpu": "^0.1.18"
},
"devDependencies": {
"@types/node": "^10.12.0"
}
}
我唯一拥有的.ts 文件是空的。所以这与文件中的代码无关,因为没有。至少我认为它与该特定文件无关。
另外,我在 Windows 10 上并使用 Visual Studio Code。下面是 vscode 环境信息:
Version: 1.28.1 (user setup)
Commit: 3368db6750222d319c851f6d90eb619d886e08f5
Date: 2018-10-11T18:13:53.910Z
Electron: 2.0.9
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
【问题讨论】:
-
请将您的 TypeScript 版本和您的 package.json 文件添加到问题中,然后希望我能够重现问题并找到原因。
-
@MattMcCutchen 我添加了您要求的信息。很抱歉这么晚才回复您。
标签: node.js typescript visual-studio-code