简体   繁体   中英

error node_modules/jest-diff/build/diffLines.d.ts(8,13): error TS1005: '=' expected. in nest js

when i start and run the nestjs app in watch mode using npm run start:dev command then this error show.

ERROR in node_modules/jest-diff/build/diffLines.d.ts(8,13): error TS1005: '=' expected.
node_modules/jest-diff/build/diffLines.d.ts(8,34): error TS1005: ';' expected.
node_modules/jest-diff/build/index.d.ts(10,13): error TS1005: '=' expected.
node_modules/jest-diff/build/index.d.ts(10,34): error TS1005: ';' expected.
node_modules/jest-diff/build/index.d.ts(11,1): error TS1128: Declaration or statement expected.
node_modules/jest-diff/build/index.d.ts(11,13): error TS1005: ';' expected.
node_modules/jest-diff/build/index.d.ts(11,52): error TS1005: ';' expected.
node_modules/jest-diff/build/printDiffs.d.ts(8,13): error TS1005: '=' expected.
node_modules/jest-diff/build/printDiffs.d.ts(8,57): error TS1005: ';' expected.

you have to update your typescript version with the latest version of typescript in your package.json file

in my case, I update with

 "typescript": "^3.9.7"

If your typescript version is "3.2.4", downgrade jest-diff to version 25.5.0. This will fix the issue. npm i jest-diff@25.5.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM