【Typescript】コンパイエラー TS6231が解決できない。
解決したいこと
Typescriptを学習中のものです。
コンパイルエラーTS6231の原因がわからず困っております。
■発生している問題・エラー
error TS6231: Could not resolve the path '' with the extensions:
'.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts'.
The file is in the program because:
Root file specified for compilation
Found 1 error.
■ディレクトリ構造
■目的と実行手順
目的
section1_type
とsection2_compile
内のsrc
内にあるtsファイルをコンパイルしたい。
コンパイルする際にはtsconfig.jsonの設定を反映させたい。
実行手順
①TSファイル内に移動
②Tsファイル内で、tsc .
を実行 → エラー発生
■package.json
{
"name": "ts",
"version": "1.0.0",
"description": "learning-typescript",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "users",
"license": "UNLICENSED",
"devDependencies": {
"@types/node": "^16",
"typescript": "^4.7"
}
}
includeとexcludeは無くても同様のエラーが発生致します。
■tsconfig.json
{
"compilerOptions": {
"target": "es2016"
"module": "commonjs"
"esModuleInterop": true
"strict": true
"skipLibCheck": true
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "*.js", "*/dist", "*/index"]
}
各バージョン
項目 | バージョン |
---|---|
typescript | 4.7.4 |
npm | 8.16.0 |
node | v14.17.4 |
ご存じでしたらご教示の程、宜しくお願い致します。