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

Viewed 7909

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.
2 Answers

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

Related