3

I 스타터로서 사용하고 angular/universal-starter 타이프 2오류 TS2300 : 식별자 중복 '수출 ='

웹팩 2. I을 사용하여 패키지를 bluebirdnodemailer 첨가. 이러한 패키지 및 관련 typings 추가 한 후 :

"@types/bluebird": "3.0.31", 
"@types/nodemailer": "1.3.30", 

그것을 나에게 터미널에서이 오류를 제공합니다

ERROR /프로젝트/node_modules/@ 유형/nodemailer/node_modules/@ 유형/블루 버드/index.d.ts (772,5) : 오류 TS2300 : 중복 식별자 '내보내기 ='.

오류 /project/node_modules/@types/bluebird/index.d.ts (772,1) : 오류 TS2300 : 중복 식별자 'export ='.

nodemailer, @ 유형/nodemailer 오래된 블루 버드 typings 버전 2.0.0입니다 @ 타입/블루 버드 (를 포함하여 자신의 node_modules 폴더가/유형 @를 설치 한 후 주 [그것이 도움이 확실하지 여부]를) :

enter image description here

tsconfig.json 파일 :

{ 
    "compilerOptions": { 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "target": "es5", 
    "module": "commonjs", 
    "removeComments": true, 
    "sourceMap": true, 
    "lib": ["es6", "dom"] 
    }, 
    "include": [ 
    "node_modules/@types/**/*.d.ts", 
    "src/**/*.ts" 
    ], 
    "exclude": [ 
    "node_modules", 
    "!node_modules/@types/**/*.d.ts" 
    ], 
    "compileOnSave": false, 
    "buildOnSave": false, 
    "atom": { 
    "rewriteTsconfig": false 
    } 
} 
,

어떻게이 오류를 해결할 수 있습니까? 감사합니다

+0

최근에 jquery와 동일한 오류 메시지가 표시되었고 tsconfig.json의 typeRoots를 추가하여 해결했습니다. [Minko Gechev의 블로그] (http://blog.mgechev.com/2016/03/28/ambient-type-definitions-duplicate-identifier-typescript-fix/)에서 더 많은 정보를 얻을 수 있습니다. – Will

답변

1

무슨 원인이 있는지 잘 모르겠습니다. 그러나 새로운 버전의 패키지에 모두 업데이트 한 후 :

"bluebird": "3.4.1", 
"nodemailer": "2.5.0", 
"@types/bluebird": "3.0.32", 
"@types/nodemailer": "1.3.31", 

을 그리고 난 다른 코드를 변경하지 않았다. 문제는 사라졌습니다.