问题
When I execute command npm run serve
there is above error:
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 |
I tried to add vuetify
to compilerOptions.types
in tsconfig.json
, but it isn't help.
回答1:
You should change the second line in src/plugins/vuetify.ts
from:
import Vuetify from 'vuetify/lib/framework';
to:
import Vuetify from 'vuetify/lib';
来源:https://stackoverflow.com/questions/65172139/could-not-find-a-declaration-file-for-module-vuetify-lib-framework