无法导入已安装的 uuid npm 包

Cla*_*per 4 javascript npm angular

我安装了 uuidnpm i uuid

并尝试import { v4 as uuidv4 } from 'uuid';按照说明导入。我检查了node_modules文件夹,uuid就在那里。但我收到一个错误Could not find a declaration file for module 'uuid'.uuid/dist/index.js' implicitly has an 'any' type.有什么想法吗?谢谢

Cla*_*per 8

安装 @types/uuid 作为开发依赖项。以某种方式解决了问题 idk。

npm i --save-dev @types/uuid