ค้นหาเว็บไซต์

angular - ไม่พบอินพุตในไฟล์คอนฟิก tsconfig.json


ผ่าน npm ฉันได้ดาวน์โหลด angular2-highcharts สำหรับแอปพลิเคชันของฉัน ฉันสังเกตเห็นว่า Visual Studio Code ให้ข้อผิดพลาดในไฟล์ tsconfig.json ของแพ็กเกจ:

file: 'file:///c%3A/pdws-view-v2/node_modules/angular2-highcharts/tsconfig.json'
severity: 'Error'
message: 'No inputs were found in config file 'c:/pdws-view-v2/node_modules/angular2-highcharts/tsconfig.json'. Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '["examples","index.d.ts","node_modules","dist"]'.'
at: '1,1'
source: 'ts'

ฉันไม่ค่อยรู้ว่าทำไมฉันถึงได้รับข้อผิดพลาดนี้หรือจะซ่อมมันอย่างไร

นี่คือไฟล์:

{
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "removeComments": true,
    "sourceMap": true,
    "outDir": "dist",
    "declarationDir": "dist",
    "declaration": true
  },
  "compileOnSave": true,
  "include": [
    "src/**/*"
  ],
  "exclude": [
    "examples",
    "index.d.ts",
    "node_modules",
    "dist"
  ],
  "angularCompilerOptions": {
    "genDir": "dist/",
    "strictMetadataEmit": true,
    "skipTemplateCodegen": true
  }
}

มีไอเดียอะไรไหม? ขอบคุณ!

คำตอบ #1

คอมไพเลอร์ TS ต้องการให้มีไฟล์ .ts ในไดเรกทอรีที่มีไฟล์ tsconfig.json ของคุณ สร้างไฟล์ว่าง file.ts ในไดเรกทอรีเดียวกันและข้อผิดพลาดควรหายไป

คำตอบ #2

ในกรณีของฉัน ฉันลืมทำสิ่งนี้: COPY src/ ./src/ มันจะคัดลอกโฟลเดอร์ src ของฉัน หลังจากคัดลอกแล้ว ฉันสามารถเรียกใช้ได้ตอนนี้: RUN yarn install --ignore-engines RUN yarn tsc

บทความที่เกี่ยวข้อง