Definitelytyped: node_modules/@types/jasmine/index.d.ts(39,52): error TS1005: '=' expected.

Created on 9 Mar 2017  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

  • [ ] I tried using the @types/jasmine package and had problems.
  • [ ] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [ ] Error: node_modules/@types/jasmine/index.d.ts(39,52): error TS1005: '=' expected.
  • [ ] Solution replace this package with older stable version. last known good package
  • [ ] when will the error fixed, cause I encounter it more than once

Most helpful comment

Seeing a variant of this with 3 closely located problems, in @types/jasmine 2.5.42 and 2.5.43 (but not seeing problem in 2.5.41) and typescript 2.2.1:

ERROR in [default] node_modules/@types/jasmine/index.d.ts:39:37 
A parameter initializer is only allowed in a function or constructor implementation.
ERROR in [default] node_modules/@types/jasmine/index.d.ts:39:45 
Cannot find name 'keyof'.
ERROR in [default] node_modules/@types/jasmine/index.d.ts:39:51 
'=' expected.

All 4 comments

We rolled back to a stable line: (In case anyone needed this)
change line 39 to
declare function spyOn(object: any, method: string): jasmine.Spy;

Seeing a variant of this with 3 closely located problems, in @types/jasmine 2.5.42 and 2.5.43 (but not seeing problem in 2.5.41) and typescript 2.2.1:

ERROR in [default] node_modules/@types/jasmine/index.d.ts:39:37 
A parameter initializer is only allowed in a function or constructor implementation.
ERROR in [default] node_modules/@types/jasmine/index.d.ts:39:45 
Cannot find name 'keyof'.
ERROR in [default] node_modules/@types/jasmine/index.d.ts:39:51 
'=' expected.

Thank you, it helped me with the same fix in line 41

Jasmine needs a minumum TypeScript version of 2.1. Dup of #14569.

Was this page helpful?
0 / 5 - 0 ratings