找不到模块“vuetify/lib/framework”的声明文件

当我执行命令时npm run serve出现上述错误:

2:21 Could not find a declaration file for module 'vuetify/lib/framework'. 'C:/Users/valut/source/repos/BricksDryierClient/client-app/node_modules/vuetify/lib/framework.js' implicitly has an 'any' type.
  Try `npm install @types/vuetify` if it exists or add a new declaration (.d.ts) file containing `declare module 'vuetify/lib/framework';`       
    1 | import Vue from 'vue';
  > 2 | import Vuetify from 'vuetify/lib/framework';
      |                     ^
    3 | 
    4 | Vue.use(Vuetify);
    5 | 

我试图添加vuetifycompilerOptions.typesin tsconfig.json,但没有帮助。

回答

您应该将第二行更改为src/plugins/vuetify.ts

import Vuetify from 'vuetify/lib/framework';

到:

import Vuetify from 'vuetify/lib';


以上是找不到模块“vuetify/lib/framework”的声明文件的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>