gpt4 book ai didi

angular - 带有 Typescript 错误 TS18003 的 Npm 服务器

转载 作者:搜寻专家 更新时间:2023-10-30 22:00:14 30 4
gpt4 key购买 nike

使用 typescript 为 Angular 2 设置环境。npm lite运行成功,但是安装typescript并添加启动脚本后,出现错误

error TS18003: No inputs were found in config file 'D:/practical/ang1/tsconfig.json'. Specified 'include' paths were '["**/"]' and 'exclude' paths were '["../wwwroot/app","node_modules/"]'.

包.json

  "scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"",
"test": "echo \"Error: no test specified\" && exit 1",
"lite": "lite-server",
"tsc": "tsc",
"tsc:w": "tsc -w"
},

tsconfig.json

{
"compilerOptions": {
"lib": [ "es5", "dom" ],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
}
}

如何解决这个错误

注意第一次“npm start”工作正常,但在删除和重置后,导致上述问题

最佳答案

在进行一些挖掘之后,我将这一行添加到 tsconfig.json 中的 compilerOptions 下。

"typeRoots" : ["../node_modules/@types/"]

关于angular - 带有 Typescript 错误 TS18003 的 Npm 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45256036/

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