简体   繁体   English

未知的编译器选项'文件'启动./node_modules/.bin/ng-xi18n

[英]Unknown compiler option 'files' launching ./node_modules/.bin/ng-xi18n

In order to translate my angular 4 app I'm trying to launch 为了翻译我的angular 4应用程序,我正在尝试启动

./node_modules/.bin/ng-xi18n from the root directory but I'm facing a problem and here is my log : ./node_modules/.bin/ng-xi18n从根目录开始,但是我遇到了问题,这是我的日志:

    Error: Error Unknown compiler option 'files'.
    at UserError.Error (native)
    at new UserError (/Users/danilodughetti/Coding/creatiweapp/creatiwe/node_modules/@angular/tsc-wrapped/src/tsc.js:27:28)
    at check (/Users/danilodughetti/Coding/creatiweapp/creatiwe/node_modules/@angular/tsc-wrapped/src/tsc.js:93:15)
    at Tsc.readConfiguration (/Users/danilodughetti/Coding/creatiweapp/creatiwe/node_modules/@angular/tsc-wrapped/src/tsc.js:152:9)
    at Object.main (/Users/danilodughetti/Coding/creatiweapp/creatiwe/node_modules/@angular/tsc-wrapped/src/main.js:65:28)
    at Object.<anonymous> (/Users/danilodughetti/Coding/creatiweapp/creatiwe/node_modules/@angular/compiler-cli/src/extract_i18n.js:16:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
Extraction failed

my package.js is like this : 我的package.js是这样的:

"name": "eheheh", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^4.4.3", "@angular/cdk": "^2.0.0-beta.12", "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "@angular/forms": "^4.2.4", "@angular/http": "^4.2.4", "@angular/material": "^2.0.0-beta.12", "@angular/platform-browser": "^4.2.4", "@angular/platform-browser-dynamic": "^4.2.4", "@angular/router": "^4.2.4", "angular2-uuid": "^1.1.1", "angularfire2": "^4.0.0-rc.2", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "firebase": "^4.4.0", "font-awesome": "^4.7.0", "hammerjs": "^2.0.8", "ng2-markdown-to-html": "^1.3.2", "ng2wig": "^0.2.1", "ngx-loading": "^1.0.7", "rxjs": "^5.4.2", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "1.4.3", "@angular/compiler-cli": "^4.2.4", "@angular/language-service": "^4.2.4", "@types/j “ name”:“ eheheh”,“ version”:“ 0.0.0”,“ license”:“ MIT”,“ scripts”:{“ ng”:“ ng”,“ start”:“ ng serve”,“ build “:” ng build“,” test“:” ng test“,” lint“:” ng lint“,” e2e“:” ng e2e“},” private“:true,” dependencies“:{” @ angular /动画“:” ^ 4.4.3“,” @ angular / cdk“:” ^ 2.0.0-beta.12“,” @ angular / common“:” ^ 4.2.4“,” @ angular / compiler“:” ^ 4.2.4“,” @ angular / core“:” ^ 4.2.4“,” @ angular / forms“:” ^ 4.2.4“,” @ angular / http“:” ^ 4.2.4“,” @角/材质”:“ ^ 2.0.0-beta.12”,“ @ angular / platform-b​​rowser”:“ ^ 4.2.4”,“ @ angular / platform-b​​rowser-dynamic”:“ ^ 4.2.4”, “ @ angular / router”:“ ^ 4.2.4”,“ angular2-uuid”:“ ^ 1.1.1”,“ angularfire2”:“ ^ 4.0.0-rc.2”,“ bootstrap”:“ ^ 3.3。 7“,” core-js“:” ^ 2.4.1“,” firebase“:” ^ 4.4.0“,” font-awesome“:” ^ 4.7.0“,” hammerjs“:” ^ 2.0.8“ ,“ ng2-markdown-to-html”:“ ^ 1.3.2”,“ ng2wig”:“ ^ 0.2.1”,“ ngx-loading”:“ ^ 1.0.7”,“ rxjs”:“ ^ 5.4。 2“,” zone.js“:” ^ 0.8.14“},” devDependencies“:{” @ angular / cli“:” 1.4.3“,” @ angular / compiler-cli“:” ^ 4.2.4“ ,“ @ angular / language-service”:“ ^ 4.2.4”,“ @ types / j asmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.1.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.3.2", "typescript": "~2.3.3" } } asmine“:”〜2.5.53“,” @ types / jasminewd2“:”〜2.0.2“,” @ types / node“:”〜6.0.60“,” codelyzer“:”〜3.1.1“,”茉莉花芯”:“〜2.6.2”,“茉莉花规格报告器”:“〜4.1.0”,“业力”:“〜1.7.0”,“业力铬启动器”:“〜2.1。 1“,” karma-cli“:”〜1.0.1“,” karma-coverage-istanbul-reporter“:” ^ 1.2.1“,” karma-茉莉花“:”〜1.1.0“,” karma-茉莉花“ -html-reporter”:“ ^ 0.2.2”,“量角器”:“〜5.1.2”,“ ts-node”:“〜3.2.0”,“ tslint”:“〜5.3.2”,“打字稿” “:”〜2.3.3“}}

Thanks 谢谢

When you see Error Unknown compiler option 'files' for TypeScript project, it is most likely that your tsconfig.json is incorrect. 当您看到TypeScript项目的Error Unknown compiler option 'files' ,很可能您的tsconfig.json不正确。

You probably have: 您可能有:

// tsconfig.json
{
  "compilerOptions": {
    ...
    "files": [ ... ]
  }
}

Rather than: 而不是:

/// tsconfig.json
{
  "compilerOptions": {
    ...
  },
  "files": [ ... ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM