网站搜索

typescript - 通过 Vercel 修改 package.json?


我正在尝试使用 Vercel 部署我的作品集,但在部署时出现错误:

src/components/header/ChangeLanguage.vue(12,25): error TS7016: Could not find a declaration file for module 'vue-i18n'. '/vercel/path0/node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js' implicitly has an 'any' type. There are types at '/vercel/path0/node_modules/vue-i18n/dist/vue-i18n.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vue-i18n' library may need to update its package.json or typings.

我在本地也遇到过这个问题,但我通过在 node_modules/vue-i18n/package.json 文件中添加 "types":"./dist/vue-i18n.d.ts" 解决了它

但是,我无法通过 Vercel 修改同一个文件,因为我无法控制它。有什么解决办法吗?

提前感谢