uni-app Error: Cannot find module '@/uni_modules/uni-upgrade-center-app/utils/check-update'
uni-app Error: Cannot find module ‘@/uni_modules/uni-upgrade-center-app/utils/check-update’
操作步骤:
- HBuilderx --> 运行 --> android
预期结果:
- 编译不报错 并且拉起自动更新
实际结果:
- 编译报错
bug描述:
接入 uni-upgrade-center-app
在使用页面调用
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
报错
Error: Cannot find module '@/uni_modules/uni-upgrade-center-app/utils/check-update'
调用checkUpdate 报错
| 信息 | 值 |
|---|---|
| 产品分类 | uniapp/App |
| PC开发环境操作系统 | Mac |
| PC开发环境版本号 | 14.0 (23A344) |
| HBuilderX类型 | 正式 |
| HBuilderX版本号 | 3.95 |
| 手机系统 | Android |
| 手机系统版本号 | Android 9.0 |
| 手机厂商 | 华为 |
| 手机机型 | 华为 P40 pro |
| 页面类型 | vue |
| vue版本 | vue2 |
| 打包方式 | 云端 |
| 项目创建方式 | HBuilderX |

更多关于uni-app Error: Cannot find module '@/uni_modules/uni-upgrade-center-app/utils/check-update'的实战教程也可以访问 https://www.itying.com/category-93-b0.html
把引用 ‘@/uni_modules/uni-upgrade-center-app/utils/check-update’ 注释掉就可以正常运行?
更多关于uni-app Error: Cannot find module '@/uni_modules/uni-upgrade-center-app/utils/check-update'的实战教程也可以访问 https://www.itying.com/category-93-b0.html
The error message Cannot find module '@/uni_modules/uni-upgrade-center-app/utils/check-update' indicates that your project is unable to locate the specified module in the given path. Here are some steps to troubleshoot and resolve this issue:
1. Verify the Module Path
- Ensure that the module
check-updateexists in the specified path:@/uni_modules/uni-upgrade-center-app/utils/. - Check for typos in the path or module name.
2. Check the uni_modules Directory
- Confirm that the
uni_modulesdirectory exists in your project root. - Ensure that the
uni-upgrade-center-appplugin is correctly installed in theuni_modulesdirectory.
3. Reinstall the Plugin
- If the plugin is missing or corrupted, reinstall it:
- Open the
uni_modulesdirectory. - Delete the
uni-upgrade-center-appfolder (if it exists). - Reinstall the plugin via the HBuilderX plugin market or manually.
- Open the
4. Check for Aliases
- The
@symbol is typically an alias for thesrcdirectory in uni-app projects. Ensure that your project configuration (e.g.,vue.config.jsorvite.config.js) correctly resolves the@alias.
5. Update Dependencies
- If the plugin is outdated, it might cause compatibility issues. Update the plugin to the latest version.
6. Clear Cache and Rebuild
- Clear the project cache and rebuild:
- In HBuilderX, go to Project > Clear Project Cache.
- Rebuild the project.
7. Check for Missing Files
- If the
check-updatefile is missing, it might have been accidentally deleted. Restore it from a backup or reinstall the plugin.
8. Debug the Code
- If the issue persists, debug the code where the module is imported. Ensure that the import statement is correct:
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';

