ERROR in [at-loader] node_modules\@types\jasmine

后端 未结 3 795
逝去的感伤
逝去的感伤 2020-12-30 02:13

My webpack build started failing out of nowhere with no packages being updated. I assume some minor version update caused this, but can\'t figure out how to get around it. D

3条回答
  •  独厮守ぢ
    2020-12-30 02:43

    If you're not using Angular 2, update your TypeScript to 2.1.6 or higher, please. This should help.

    According to this discussion, a more correct solution is to keep TypeScript updated to the latest stable minor version of 2.x branch, which is 2.1.6 as of now (Feb 12, 2017). The error you have in a build log indicates that you are using an outdated 2.0.10 version. The latest jasmine definition file has a new syntax check in spyOn() function which is available only for TypeScript >=2.1.0. Generally, you should have no serious reason to stick to 2.0.10, so, please upgrade. However, if there's a backward compatibility issue preventing you from the upgrade, you should fill in the issue form here: https://github.com/Microsoft/TypeScript/issues and make the compiler team aware of a bug.

    UPD: Avoid in your package.json lines like these: "typescript": "2.0.10, "typescript": "~2.0.0". Instead of ~ you should apply ^ restriction (allows to update minor version numbers, not only hotfixes) like "typescript": ^2.0.0".

    Hope that helps. Sorry for the inconvenience.

提交回复
热议问题