2016-07-04 5 views
2

Visual Studio 코드에서 작업을 실행하는 동안이 문제가 발생합니다. 다음은 참조 용 스크린 샷입니다. 여기 오류 TS5023 : 알 수없는 컴파일러 옵션 'p'

enter image description here

systemjs.config.js에 대한 tsconfig.json

{ 
    "compilerOptions": { 
    "noImplicitAny": true, 
    "noEmitOnError": true, 
    "sourceMap": true, 
    "experimentalDecorators": true, 
    "emitDecoratorMetadata": true, 
    "target": "es5", 
    "module": "commonjs", 
    "moduleResolution": "node" 
    }, 
    "exclude": [ 
    "node_modules", 
    "wwwroot", 
    "typings" 
    ], 
    "compileOnSave": true 
} 

및 코드 tasks.json

{ 
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format 
    "version": "0.1.0", 
    "command": "tsc", 
    "isShellCommand": true, 
    "args": ["-p", "."], 
    "showOutput": "always", 
    "problemMatcher": "$tsc" 
} 

및 코드에 대한 코드입니다

/** 
* System configuration for Angular 2 samples 
* Adjust as necessary for your application needs. 
*/ 
(function (global) { 
    // map tells the System loader where to look for things 
    var map = { 
     'app': 'app', // 'dist', 
     '@angular': 'node_modules/@angular', 
     'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 
     'rxjs': 'node_modules/rxjs' 
    }; 
    // packages tells the System loader how to load when no filename and/or no extension 
    var packages = { 
     'app': { main: 'main.js', defaultExtension: 'js' }, 
     'rxjs': { defaultExtension: 'js' }, 
     'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, 
    }; 
    var ngPackageNames = [ 
     'common', 
     'compiler', 
     'core', 
     'http', 
     'platform-browser', 
     'platform-browser-dynamic', 
     'router', 
     'router-deprecated', 
     'upgrade', 
    ]; 
    // Individual files (~300 requests): 
    function packIndex(pkgName) { 
     packages['@angular/' + pkgName] = { main: 'index.js', defaultExtension: 'js' }; 
    } 
    // Bundled (~40 requests): 
    function packUmd(pkgName) { 
     packages['@angular/' + pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; 
    }; 
    // Most environments should use UMD; some (Karma) need the individual index files 
    var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; 
    // Add package entries for angular packages 
    ngPackageNames.forEach(setPackageConfig); 
    var config = { 
     map: map, 
     packages: packages 
    } 
    System.config(config); 
})(this); 

이 문제를 해결할 때 도움을주세요. 내가 잘못했는지 전혀 알 수 없습니다.

+0

'tsc' 작업을 제거 할 수 있습니다. 파일을 비워 두십시오. 그리고 나서'cmd'를 열고 거기에서'tsc'를 실행하십시오 – AngJobs

+0

같은 해결책이 있습니까? – mehran

+0

아니요 처음부터 모든 것을 만들었습니다. – rashfmnb

답변

0

Microsoft SDK과 같은 다른 패키지와 함께 설치된 TypeScript의 이전 버전을 실행하고있을 수 있습니다. 콘솔을 열고 tsc을 실행하십시오. 원하는 버전인지 확인하십시오. 그렇지 않다면 올바른 버전을 먼저 찾으려면 path 환경 변수를 수정해야합니다.

1

seairth는

가 지원되는 옵션, 예를 들어, -p 있는지 tsc --help을 당신이 방금 설치 한 TSC의 새로운 버전이 있는지 확인하기 위해 tsc --version를 실행하거나, 수, 정확 나는 새로운 버전 2.5.2 설치했습니다,하지만 난 tsc --version을 실행할 때, 항상, 그것은 충돌 경로에 의해 발생한다 1.0.3

를보고 PATH 환경, 예로부터 Microsoft SDK에서 TSC 경로를 삭제 C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;이 문제를 해결해야합니다.

관련 문제