我在使用“lodash”时报Could not find a declaration file for module 'lodash/cloneDeep'.(找不到模块的声明文件'lodash/cloneDeep')
解决方法一:
如果是在ts环境下,就看一下有没有对应的ts版本的包 。下载对应的ts版本的包一般是 npm i @types/xxx
npm install -D @types/lodash
解决方法二:
并不是所有的包都有ts的版本,所以更建议使用这种方法
在.d.ts的声明文件(没有的话自己建一个)中写入declare module "xxx" 找不那个模块写那个模块