0


VUE报错解决Could not find a declaration file for module ‘xxx‘.

Github上下载的代码,导入后出现以下报错。

错误代码

Could not find a declaration file for module 'element-plus/dist/locale/zh-cn.mjs'. 'c:/Users/Lenovo/typescript/hotel/hotel-system-web-main/node_modules/element-plus/dist/locale/zh-cn.mjs' implicitly has an 'any' type.
If the 'element-plus' package actually exposes this module, try adding a new declaration (.d.ts) file containing declare module 'element-plus/dist/locale/zh-cn.mjs';ts(7016)

解决办法:

修改tsconfig.json文件,

追加一下内容

"noImplicitAny": false,

"allowJs": true,

小白一个,原理不懂,但该报红已解决。


本文转载自: https://blog.csdn.net/lina_lee1/article/details/130249610
版权归原作者 lina_lee1 所有, 如有侵权,请联系我们删除。

“VUE报错解决Could not find a declaration file for module ‘xxx‘.”的评论:

还没有评论