when starting my project ng serve
i get this error.
updated my ts and did not help.
here is the error
ERROR in node_modules/@types/node/assert.d.ts(3,68): error TS1144: '{' or ';' expected. node_modules/@types/node/assert.d.ts(57,68): error TS1144: '{' or ';' expected. node_modules/@types/node/assert.d.ts(66,94): error TS1144: '{' or ';' expected. node_modules/@types/node/assert.d.ts(66,101): error TS1005: ';' expected. node_modules/@types/node/assert.d.ts(66,104): error TS1005: ';' expected. node_modules/@types/node/assert.d.ts(68,98): error TS1144: '{' or ';' expected. node_modules/@types/node/assert.d.ts(68,105): error TS1005: ';' expected. node_modules/@types/node/assert.d.ts(68,108): error TS1005: ';' expected. node_modules/@types/node/assert.d.ts(76,47): error TS1144: '{' or ';' expected. node_modules/@types/node/assert.d.ts(76,53): error TS1005: ';' expected. node_modules/@types/node/assert.d.ts(76,56): error TS1005: ';' expected. node_modules/@types/node/assert.d.ts(106,61): error TS1005: ';' expected. node_modules/@types/node/base.d.ts(10,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/base.d.ts(11,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/base.d.ts(12,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/base.d.ts(13,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.4/base.d.ts(10,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.4/base.d.ts(11,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.4/base.d.ts(12,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.4/base.d.ts(13,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.6/base.d.ts(10,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.6/base.d.ts(11,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.6/base.d.ts(12,1): error TS1084: Invalid 'reference' directive syntax. node_modules/@types/node/ts3.6/base.d.ts(13,1): error TS1084: Invalid 'reference' directive syntax.`
This is probably an incompatibility issue between your TypeScript version and some of your @types packages. I'll walk you through the solution with a step by step example:
"devDependencies": {
// ...
"@types/deep-freeze": "0.1.1",
"@types/jasmine": "3.5.10",
"@types/lodash.isequal": "4.5.5",
"@types/lodash.mergewith": "4.6.6",
"@types/lodash.remove": "4.7.6",
"@types/lodash.some": "4.6.6",
// ...
"typescript": "2.9.2",
// ...
}
For each of your @types packages do: npm dist-tags @types/<your-types-package-name>
. You'll now see a table that indicates which TypeScript version works with each of the @types package version
Update your @types in your package.json with the corresponding versions
If the solution does not work try updating TypeScript to a newer version!
In case your using "typescript": "~3.1.6" in the package.json file, change "@types/node" version to "@types/node": "14.6.2", in the package.json file, That solved my problem..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With