问题描述
我正在跟踪lodash错误
I am getting following lodash error
推荐答案
解决方案1
我也遇到了同样的问题,我尝试将打字稿版本和lodash版本降级,但是没有任何效果,最后我尝试安装@ types/lodash,并且它起作用了.只需尝试一下:
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
希望有帮助.
如果上述解决方案不起作用,请尝试以下操作:
解决方案2
实际的问题是,排除已添加到2.8版的打字稿中.您可能有一个@ types/lodash版本,该版本至少需要打字稿2.8,如果您的lodash和打字稿版本不匹配,则可能会发生这种情况.
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.
因此,使用此代码安装与lodash兼容的最新打字稿2.3版本:
So, install the last typescript 2.3 version compatible with lodash using this code :
npm i -D @types/[email protected]
这篇关于在构建'找不到名称'排除'后出现lodash错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!