更新我的npm软件包后,"vue"模块的某些导入开始显示错误:
TS2305:模块".././node_modules/vue/dist/vue"没有导出的成员"X"
其中X代表下一个时钟、未安装、参考、手表等.
我试过的:
- 回滚到以前使用的Vue版本"3.2.2">;"3.0.11". 它使上述类型错误消失,但应用程序完全停止工作,在控制台中显示大量
TypeError: Object(...) is not a function
个错误,并且根本不呈现应用程序.在终端中,引入了一些新的警告: - 回滚其他依赖项.不幸的是,我try 过的方法都没有解决这个问题.
- 手动声明整个"vue"模块.我们可以在vue中声明"vue"模块导出.d、 但是,这似乎是一个可怕的、耗时的解决方法,所以如果可能的话,我会 Select 一个更好的解决方案.
我的依赖项完整列表:
"dependencies": {
"@capacitor/android": "3.0.0",
"@capacitor/app": "1.0.0",
"@capacitor/core": "3.0.0",
"@capacitor/haptics": "1.0.0",
"@capacitor/keyboard": "1.0.0",
"@capacitor/push-notifications": "^1.0.3",
"@google-pay/button-element": "^2.5.0",
"@ionic-native/core": "^5.34.0",
"@ionic-native/qr-scanner": "^5.35.0",
"@ionic-native/vibration": "^5.34.0",
"@ionic/vue": "^5.4.0",
"@ionic/vue-router": "^5.4.0",
"@j-t-mcc/vue3-chartjs": "^1.1.2",
"chart.js": "^3.4.1",
"chartjs-plugin-datalabels": "^2.0.0",
"color": "^3.1.3",
"cordova-plugin-background-mode": "^0.7.3",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-qrscanner": "^3.0.1",
"core-js": "^3.6.5",
"firebase": "^8.6.2",
"numeral": "^2.0.6",
"pug": "^3.0.2",
"pug-plain-loader": "^1.1.0",
"secure-ls": "^1.2.6",
"uuid": "^8.3.2",
"v-cupertino": "^1.2.4",
"vue": "^3.2.0",
"vue-chartjs": "^3.5.1",
"vue-i18n": "^9.1.3",
"vue-numerals": "^4.0.6",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.1"
},
"devDependencies": {
"@capacitor/cli": "3.0.0",
"@types/jest": "^24.0.19",
"@types/uuid": "^8.3.1",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-e2e-cypress": "~4.5.0",
"@vue/cli-plugin-eslint": "^4.5.13",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-unit-jest": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0-0",
"@vue/eslint-config-typescript": "^5.0.2",
"@vue/test-utils": "^2.0.0-0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"typescript": "~3.9.3",
"vue-jest": "^5.0.0-0"
}