following lodash error on build 'Cannot find name 'Exclude'' following lodash error on build 'Cannot find name 'Exclude'' angular angular

following lodash error on build 'Cannot find name 'Exclude''


Solution 1
I also had the same issue, i tried to downgrade typescript version and lodash version, but nothing worked, and at last i tried installing @types/lodash, and it worked.just try this:

npm i @types/lodash

hope it helps.

If the above solution doesn't work try this:

Solution 2
The actual issue is, Exclude was added to typescript on version 2.8. You might have a version of @types/lodash that needs minimum typescript 2.8, and it can happen if your lodash and typescript version didn't match.

So, install the last typescript 2.3 version compatible with lodash using this code :

npm i -D @types/lodash@ts2.3


I'm facing the same issue this morning. One possible solution for me is to fix the lodash version in the package.json :

"lodash": "^4.17.4" => "lodash": "4.17.4"

"@types/lodash": "^4.14.55" => "@types/lodash": "4.14.55"

And waiting for a more stable fix/solution.

Hope that works for you


There are recent updates on lodash typingsreference : https://www.npmjs.com/package/@types/lodashLast updated: Mon, 04 Mar 2019 22:42:42 GMT

changing "@types/lodash": "4.14.121" worked for me as this was the most stable version referred prior to recent update.

Hope this helps.