TS7016: Could not find a declaration file for module 'three'. 'XXXX/node_modules/three/build/three.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/three` if it exists or add a new declaration (.d.ts) file containing `declare module 'three';`
在导入threejs报上面的错误,然后网上得到解决方案。
第一种解决方式,根据提示安装对应ts库npm install “@types/***”:
npm i --save-dev @types/three
第二种方式:创建或查找项目shims-vue.d.ts文件加入如下:
//declare module 'xxx'对应库名
declare module 'three'