node_modules/@fullcalendar/core/main.d.ts(1196,54) 中的错误:错误 TS1144:预期'{'或';'



我正试图在我的项目中运行npm run build,但我遇到了这个错误:

ERROR in node_modules/@fullcalendar/core/main.d.ts(1196,54): error TS1144: '{' or ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1197,34): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1197,45): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1198,17): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1199,34): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1199,51): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1199,64): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1200,28): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1200,54): error TS1109: Expression expected.
node_modules/@fullcalendar/core/main.d.ts(1200,89): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1201,24): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1201,33): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1202,20): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1203,26): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1203,32): error TS1109: Expression expected.
node_modules/@fullcalendar/core/main.d.ts(1204,25): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1204,31): error TS1109: Expression expected.
node_modules/@fullcalendar/core/main.d.ts(1205,26): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1206,30): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1206,48): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1207,35): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1207,54): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1208,32): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1208,38): error TS1109: Expression expected.
node_modules/@fullcalendar/core/main.d.ts(1209,24): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1209,30): error TS1109: Expression expected.
node_modules/@fullcalendar/core/main.d.ts(1210,31): error TS1005: ',' expected.
node_modules/@fullcalendar/core/main.d.ts(1210,47): error TS1005: ';' expected.
node_modules/@fullcalendar/core/main.d.ts(1210,53): error TS1109: Expression expected.
node_modules/@fullcalendar/core/main.d.ts(1214,1): error TS1128: Declaration or statement expected.
node_modules/@fullcalendar/core/main.d.ts(2698,27): error TS1005: ',' expected. 

我试图更改打字稿的版本,但该项目希望版本低于2.8,大于2.7。因此,错误仍然存在。有人能帮我解决吗?

检查您的"typeRoots";在tsconfig文件中它可能有其他一些不应该检查的地址。应该是

{
"compilerOptions": {
"typeRoots": [
"node_modules/@types"
]
}
}

同时尝试删除node_modules文件夹和package-lock.json并运行npm i

对我来说,这是一个我的package-lock.json没有被签入源代码管理的问题。我的构建服务器会尝试恢复模块,但获取了错误的版本,这导致了这个问题。

相关内容

  • 没有找到相关文章

最新更新