SolvedDefinitelyTyped Error: node_modules/@types/jasmine/index.d.ts(138,47): error TS1005: ';' expected.

If you know how to fix the issue, make a pull request instead.

  • [ I tried using the @types/jamine package and had problems( 2.8.11)
    https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jasmine/index.d.ts

I have the following errors

Error: node_modules/@types/jasmine/index.d.ts(138,47): error TS1005: ';' expected.
node_modules/@types/jasmine/index.d.ts(138,90): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(138,104): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(138,112): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,113): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,121): error TS1005: ')' expected.
node_modules/@types/jasmine/index.d.ts(138,147): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(138,162): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(138,163): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,164): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,165): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,179): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,183): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,208): error TS1005: '{' expected.
node_modules/@types/jasmine/index.d.ts(138,217): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,222): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,227): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,228): error TS1109: Expression expected.
node_modules/@types/jasmine/index.d.ts(138,230): error TS1005: ')' expected.

@armanio123

49 Answers

✔️Accepted Answer

As a side note, upgrading these types to require TS 2.8+ is not a minor release, this has broken many projects which now need to pin to an older types/jasmine version.
This was a major breaking change and should of been a new major version number 😢

Pinning to 2.8.3 and leaving TS on a project that couldn't go beyond 2.5.3 worked.

Other Answers:

Hi @burtek Thanks you very much for your support.I checked version history and i see they have updated to newer version yesterday because of that changes it was getting failed i went back and changed to 2.8.9 its working fine.

Not really. The package itself says it's for TS 2.8+, and some parts of syntax used in line 138 have been first introduced in TS 2.7 (i.e. Constant-named properties) and TS 2.8 (i.e. Conditional Types).

TS 2.6.2 is pretty old, with latest version of TS being 3.1.6

Ok, I will check if it's ok tu upgrade for new projects.
I've tested with typescript 3.1.6 and it works.

Thank you @burtek

@vnazarchukmob is it possible you have typescript installed both globally and locally and one of them is below 2.8?

@mowgliLab as I mentioned above, @types/jasmine is for TS 2.8+, while you're still using TS 2.7.x. Upgrade typescript to at least 2.8.0.

More Issues: