2017-03-24 1 views
1

npm start 명령으로 Angular2 Project를 실행할 때 중복 식별자 내보내기가 발생합니다. 많이 검색했지만 문제의 정확한 해결책을 찾을 수 없습니다. package.json, typings.json 아래 tsconfig.json.npm에서 Angular2 Project를 시작하는 동안 중복 식별자 내보내기 오류가 발생했습니다.

감사 Alper

package.json 

{ 
"name": "Angular2SampleProject2", 
"version": "1.0.0", 
"scripts": { 
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", 
"e2e": "tsc && concurrently \"http-server -s\" \"protractor 
protractor.config.js\" --kill-others --success first", 
"lint": "tslint ./app/**/*.ts -t verbose", 
"lite": "lite-server", 
"pree2e": "webdriver-manager update", 
"test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", 
"test-once": "tsc && karma start karma.conf.js --single-run", 
"tsc": "tsc", 
"tsc:w": "tsc -w" }, 
"license": "ISC", 
"dependencies": { 
"@angular/common": "2.4.0", 
"@angular/compiler": "2.4.0", 
"@angular/core": "2.4.0", 
"@angular/forms": "2.4.0", 
"@angular/http": "2.4.0", 
"@angular/platform-browser": "2.4.0", 
"@angular/platform-browser-dynamic": "2.4.0", 
"@angular/router": "3.4.0", 
"angular-in-memory-web-api": "0.2.2", 
"systemjs": "0.19.40", 
"core-js": "2.4.1", 
"reflect-metadata": "0.1.8", 
"rxjs": "5.0.1", 
"zone.js": "0.7.4" 
    }, 
"devDependencies": { 
    "concurrently": "3.1.0", 
    "lite-server": "2.2.2", 
    "typescript": "2.0.10", 

"canonical-path": "0.0.2", 
"http-server": "^0.9.0", 
"tslint": "^3.15.1", 
"lodash": "^4.16.4", 
"jasmine-core": "~2.4.1", 
"karma": "^1.3.0", 
"karma-chrome-launcher": "^2.0.0", 
"karma-cli": "^1.0.1", 
"karma-jasmine": "^1.0.2", 
"karma-jasmine-html-reporter": "^0.2.2", 
"protractor": "~4.0.14", 
"rimraf": "^2.5.4", 

"@types/node": "6.0.46", 
"@types/jasmine": "2.5.36" 
} 
} 

tsconfig.json

{ 
"compilerOptions": { 
"target": "es5", 
"module": "commonjs", 
"moduleResolution": "node", 
"sourceMap": true, 
"emitDecoratorMetadata": true, 
"experimentalDecorators": true, 
"lib": [ "es2015", "dom" ], 
"noImplicitAny": true, 
"suppressImplicitAnyIndexErrors": true 
} 
} 

에로 r 메시지 :

Types of property 'pause' are incompatible. 
    Type '() => void' is not assignable to type '() => ReadWriteStream'. 
    Type 'void' is not assignable to type 'ReadWriteStream'. 
    typings/globals/node/index.d.ts(2301,5): error TS2300: Duplicate 
    identifier 'export='.typings/globals/node/index.d.ts(2323,18): error 
TS2300: Duplicate identifier 'Domain'. 
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
npm ERR! node v4.4.4 
npm ERR! npm v2.15.1 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] start: `tsc && concurrently "tsc -w""lite 
-server" `npm ERR! Exit status 2 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'tsc && 
concurrently "tsc -w" "lite-server" '. 
npm ERR! This is most likely a problem with the Angular2SampleProject2 

패키지, npm ERR! npm 자체가 아닙니다. npm ERR! 시스템에 오류가 발생했음을 작성자에게 알려주십시오. npm ERR! tsc & & 동시에 "tsc -w" "lite-server" npm ERR! 이 프로젝트의 문제점을 열 수있는 방법에 대한 정보는 : npm ERR! npm 버그 Angular2SampleProject2 npm ERR! 또는 사용할 수없는 경우 다음을 통해 정보를 얻을 수 있습니다. npm ERR! npm ERR! npm 소유자 l Angular2SampleProject2 npm ERR! 위의 추가 로깅 출력이있을 수 있습니다.

npm ERR! 지원 요청과 함께 다음 파일을 포함하십시오. npm ERR! C : \ Users \ kopuz \ workspace \ Angular2SampleProject2 \ npm-debug.log

+0

매우 모호하다. 도움을 얻기 위해 더 자세한 정보가 필요합니다. 전체 오류 메시지를 제공 할 수 있습니까? – Diullei

+0

''exclude ': [ "node_modules"]'를'tsconfig.json'에 추가하려고 했습니까? – Saravana

+0

안녕하세요. 내 질문에 오류 메시지를 추가했습니다. 당신은 메시지에서 그것을 볼 수 있습니다. 제가 놓친 간단한 것들이 있어야합니다. – user2307786

답변

1

며칠 전 동일한 문제가 발생했습니다. 내가하여 동일한 고정 : package.json에 "@angular/compiler": "~2.4.9", "@angular/core": "~2.4.9"7.7.2

  • 업데이트 내 노드 버전을 업데이트

    여기 내 tsconfig은 이제 다음과 같습니다 것 같다

    { 
        "compilerOptions": { 
        "target": "es6", 
        "module": "commonjs", 
        "moduleResolution": "node", 
        "sourceMap": true, 
        "emitDecoratorMetadata": true, 
        "experimentalDecorators": true, 
        "removeComments": false, 
        "noImplicitAny": true, 
        "lib": [ 
         "es6", 
         "dom" 
        ] 
        }, 
        "typeRoots": [ 
        "node_modules/@types" 
        ], 
        "types": [ 
        "core-js", 
        "hammerjs" 
        ], 
        "exclude": [ 
        "node_modules" 
        ] 
    } 
    
  • +0

    내 문제도 해결 anoop.it 고맙습니다. – user2307786

    관련 문제