I tried using the @types/lodash package and had problems.
Compiled with tsc v2.1.1
@bczengel , @Sheeo
received the following errors:
node_modules/@types/lodash/index.d.ts(11444,21): error TS1005: ']' expected.
node_modules/@types/lodash/index.d.ts(11444,22): error TS1005: ';' expected.
node_modules/@types/lodash/index.d.ts(11444,23): error TS1128: Declaration or statement expected.
node_modules/@types/lodash/index.d.ts(11444,33): error TS1005: ']' expected.
node_modules/@types/lodash/index.d.ts(11444,34): error TS1005: ')' expected.
node_modules/@types/lodash/index.d.ts(11444,35): error TS1128: Declaration or statement expected.
node_modules/@types/lodash/index.d.ts(11444,37): error TS1128: Declaration or statement expected.
node_modules/@types/lodash/index.d.ts(19441,1): error TS1128: Declaration or statement expected.
~$ tsc -v
Version 2.1.1
Cannot reproduce using TypeScript 2.1.5
Upgrading to 2.1.5 solved this issue for me.
TypeScript 2.1.5+ resolves this issue.
Thanks.
According to semantic versioning, there was a significant change which is breaking actually, so the version name has to be something like 4.15.0 or even 5.0.0 but not 4.14.52.
Where can I see the full list of releases for @types/lodash?
@stepanzarubin no, the semantic version of the type declarations follows the semantic version of the lodash version they target, currently 4.14. See this issue and this issue for discussion of it.
There currently seems to be no way to indicate from the typings that you'll need a newer TypeScript version to compile them -- all of this orthogonal to the version of the lodash package itself.
This is a duplicate of https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14338.
All @types packages have compiler version tags on them. e.g. @ts2.0 or @ts2.1. so fixing the version of your dependency to @types/[email protected] should avoid getting an incompatible version.
Most helpful comment
Upgrading to
2.1.5solved this issue for me.