找不到模块:无法解析“../文件”
Module not found: can't resolve '../file'
我正在使用 electron-vue 开发应用程序。在 windows 中,yarn run dev
就可以正常工作。但后来我决定切换到 Ubuntu 18.04,现在每次我执行 yarn run dev
,它 returns 就像这样:
ERROR in ./node_modules/iaccs-login/router/OneTimePassword.js
Module not found: Error: Can't resolve '../components/OneTimePassword' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-login/router'
@ ./node_modules/iaccs-login/router/OneTimePassword.js 4:15-55
@ ./src/renderer/router/index.js
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./node_modules/iaccs-front-office-otc-voucher/router/index.js
Module not found: Error: Can't resolve '../components/OtcVoucher' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-front-office-otc-voucher/router'
@ ./node_modules/iaccs-front-office-otc-voucher/router/index.js 4:15-50
@ ./src/renderer/router/FrontOffice.js
@ ./src/renderer/router/index.js
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue
Module not found: Error: Can't resolve '../constants/Withdrawal' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-front-office-withdrawal/components'
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue 9:0-92
@ ./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue
@ ./node_modules/iaccs-front-office-withdrawal/router/index.js
@ ./src/renderer/router/FrontOffice.js
@ ./src/renderer/router/index.js
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./src/renderer/mixins/Auth.js
Module not found: Error: Can't resolve '../store/Modules' in '/mnt/d/iaccs/iaccs-base/src/renderer/mixins'
@ ./src/renderer/mixins/Auth.js 1:12-63
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./src/renderer/store/index.js
Module not found: Error: Can't resolve './Modules' in '/mnt/d/iaccs/iaccs-base/src/renderer/store'
@ ./src/renderer/store/index.js 5:0-32
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
我已经检查过文件,没有遗漏任何东西。是不是我做错了什么?
谢谢!
已解决!
原来是个很简单的问题。我使用 windows 太久了,我忘记了 Linux 对目录和文件名区分大小写。我刚刚根据我的代码重命名了我的目录和文件,yarn run dev
现在可以使用了!
我正在使用 electron-vue 开发应用程序。在 windows 中,yarn run dev
就可以正常工作。但后来我决定切换到 Ubuntu 18.04,现在每次我执行 yarn run dev
,它 returns 就像这样:
ERROR in ./node_modules/iaccs-login/router/OneTimePassword.js
Module not found: Error: Can't resolve '../components/OneTimePassword' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-login/router'
@ ./node_modules/iaccs-login/router/OneTimePassword.js 4:15-55
@ ./src/renderer/router/index.js
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./node_modules/iaccs-front-office-otc-voucher/router/index.js
Module not found: Error: Can't resolve '../components/OtcVoucher' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-front-office-otc-voucher/router'
@ ./node_modules/iaccs-front-office-otc-voucher/router/index.js 4:15-50
@ ./src/renderer/router/FrontOffice.js
@ ./src/renderer/router/index.js
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue
Module not found: Error: Can't resolve '../constants/Withdrawal' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-front-office-withdrawal/components'
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue 9:0-92
@ ./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue
@ ./node_modules/iaccs-front-office-withdrawal/router/index.js
@ ./src/renderer/router/FrontOffice.js
@ ./src/renderer/router/index.js
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./src/renderer/mixins/Auth.js
Module not found: Error: Can't resolve '../store/Modules' in '/mnt/d/iaccs/iaccs-base/src/renderer/mixins'
@ ./src/renderer/mixins/Auth.js 1:12-63
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./src/renderer/store/index.js
Module not found: Error: Can't resolve './Modules' in '/mnt/d/iaccs/iaccs-base/src/renderer/store'
@ ./src/renderer/store/index.js 5:0-32
@ ./src/renderer/main.js
@ multi ./.electron-vue/dev-client ./src/renderer/main.js
我已经检查过文件,没有遗漏任何东西。是不是我做错了什么?
谢谢!
已解决!
原来是个很简单的问题。我使用 windows 太久了,我忘记了 Linux 对目录和文件名区分大小写。我刚刚根据我的代码重命名了我的目录和文件,yarn run dev
现在可以使用了!