gpt4 book ai didi

javascript - 如何解决文件具有不支持的扩展名。唯一支持的扩展名是 '.ts' 、 '.tsx' 、 '.d.ts' 、 '.js' 、 '.jsx'

转载 作者:行者123 更新时间:2023-12-05 07:04:50 25 4
gpt4 key购买 nike

我无法解决这个特定错误:

File 'D:/coreui-todo-app/node_modules/multiple-textbox/....' has unsupported extension. The onlysupported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.

我实现的解决方案如下。

输入值

  "allowJs": true

"compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowJs": true,
"module": "esnext",
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"esnext",
"dom"
]
}

但是,我仍然面临同样的问题。

附上截图:

enter image description here


按照@Pointy 的建议更新了屏幕截图以删除 .spec.ts -

enter image description here

最佳答案

tsconfig.json 有一个不受支持的扩展

我通过调整脚本解决了这个问题。

tsc-watch --compiler typescript/bin/tsc

并从命令中删除了 tsconfig.json。

关于javascript - 如何解决文件具有不支持的扩展名。唯一支持的扩展名是 '.ts' 、 '.tsx' 、 '.d.ts' 、 '.js' 、 '.jsx',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62860436/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com