I am getting following lodash error
ERROR in node_modules/@types/lodash/common/object.d.ts(1689,12): error TS2304: Cannot find name 'Exclude'. node_modules/@types/lodash/common/object.d.ts(1766,12): error TS2304: Cannot find name 'Exclude'. node_modules/@types/lodash/common/object.d.ts(1842,34): error TS2304: 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/[email protected]
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 typings reference : https://www.npmjs.com/package/@types/lodash Last 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With