gpt4 book ai didi

angular - 错误 TS2300 : Duplicate identifier 'export='

转载 作者:太空狗 更新时间:2023-10-29 17:57:46 27 4
gpt4 key购买 nike

我正在使用 angular/universal-starter作为使用 TypeScript 2 和 Webpack 2 的初学者。

我添加了软件包 bluebirdnodemailer。添加这些包和相关类型后:

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

它在终端中给我这个错误:

ERROR in /project/node_modules/@types/nodemailer/node_modules/@types/bluebird/index.d.ts (772,5): error TS2300: Duplicate identifier 'export='.

ERROR in /project/node_modules/@types/bluebird/index.d.ts (772,1): error TS2300: Duplicate identifier 'export='.

[不确定是否有帮助] 注意在安装 @types/nodemailer 后,@type/nodemailer 有自己的 node_modules 文件夹,包括 @type/bluebird(这是一个老 bluebird 打字版本 2.0.0):

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
}
}

如何解决这个错误?谢谢

最佳答案

不知道是什么原因造成的。但是在将它们全部更新到新版本包之后:

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

而且我没有更改任何其他代码。问题消失了。

关于angular - 错误 TS2300 : Duplicate identifier 'export=' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39050383/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com