2016-06-04 3 views
0

젠킨스로 타이프 스크립트 프로젝트를 만들려고합니다. 하지만 tsc를 실행할 때 typescript 파일에서 비표준 가져 오기와 관련된 오류가 발생합니다.typescript tsc error TS2307 : '@ angular/core'모듈을 찾을 수 없습니다.

다음은 빌드에서 발췌 한 것입니다. 여기

+ ls node_modules/@angular/ 
common 
compiler 
core 
http 
platform-browser 
platform-browser-dynamic 
router 
router-deprecated 
+ tsc 
client/dev/marvel-app/app.component.ts(2,25): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/app.component.ts(3,9): error TS2305: Module '"/root/.jenkins/jobs/marvel-encyclopedia/workspace/node_modules/@angular/router-deprecated/index"' has no exported member 'RouteConfig'. 
client/dev/marvel-app/helpers/parallax.directive.ts(8,17): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/filter/filter.component.ts(1,51): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/go-back-up/go-back-up.component.ts(1,25): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/graph/graph.component.ts(1,100): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/grid/grid.component.ts(1,62): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/header/header.component.ts(1,25): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/navbar/navbar.component.ts(1,25): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/search/search.component.ts(1,51): error TS2307: Cannot find module '@angular/core'. 
client/dev/marvel-app/modules/search/search.component.ts(2,23): error TS2307: Cannot find module '@angular/common'. 

내 tsconfig.json 파일의 내용이다 :

{ 
    "compilerOptions": { 
     "module": "commonjs", 
     "moduleResolution": "node", 
     "target": "es5", 
     "sourceMap": true, 
     "emitDecoratorMetadata": true, 
     "experimentalDecorators": true, 
     "noImplicitAny": false 
    }, 
    "exclude": [ 
     "node_modules", 
     "typings", 
     "typings/main", 
     "typings/main.d.ts" 
    ], 
    "filesGlob": [ 
     "**/*.ts", 
     "typings/main", 
     "typings/main.d.ts" 
    ] 
} 

내 Mac에서 로컬 시도하고 그것을 잘 작동합니다. 젠킨스 (Jenkins)는 리눅스 머신에있다.

EDIT : 사실 노드 모듈이 잘못 설치되어 오류가 발생했습니다. node_modules을 삭제하고 해당 문제를 다시 설치하십시오.

답변

0

당신은 같은 tsconfig 한 다음

"exclude": [ 
     "node_modules", 
     "typings", 
     "typings/main", 
     "typings/main.d.ts" 
    ], 
    "filesGlob": [ 
     "**/*.ts", 
     "typings/main", 
     "typings/main.d.ts" 
    ] 

는 대부분의 경우 filesGlob은 빌드 프로세스에서 지원되지 않고 exclude는 filesGlob에 포함 따라서는 로컬로 작동되는 (당신은 typings/main 제외되어에서 발로되어있다.)

관련 문제