Environment Configuration Issues
This page collects common issues and solutions encountered during uni-app development environment configuration.
HBuilderX Related Issues
Q: HBuilderX fails to start after installation
Problem Description: No response when double-clicking the HBuilderX icon after installation, or the application crashes.
Solutions:
- Check if antivirus software is blocking it, try adding to whitelist
- Run HBuilderX as administrator
- Re-download the installation package and reinstall
- Check if the system meets minimum requirements (Windows 7 SP1 and above, macOS 10.13 and above)
Q: HBuilderX plugin installation fails
Problem Description: "Installation failed" message or long unresponsive periods when installing plugins in HBuilderX.
Solutions:
- Check if network connection is normal
- Try switching network environments (e.g., from company network to personal hotspot)
- Close HBuilderX, delete temporary files in plugin directory, restart and reinstall
- Manually download plugin package and install offline
Q: Node.js environment not recognized
Problem Description: HBuilderX prompts "Node.js environment not detected".
Solutions:
- Ensure Node.js is correctly installed (LTS version recommended)
- Check if Node.js has been added to system environment variables
- Manually configure Node.js path in HBuilderX: Tools -> Settings -> Run Configuration -> Node.js Path
- Restart HBuilderX and computer
WeChat Developer Tools Related Issues
Q: Cannot connect to WeChat Developer Tools
Problem Description: "Cannot connect to WeChat Developer Tools" message when running to WeChat Developer Tools from HBuilderX.
Solutions:
- Ensure the latest version of WeChat Developer Tools is installed
- Enable service port in WeChat Developer Tools: Settings -> Security Settings -> Service Port
- Check if the WeChat Developer Tools path configured in HBuilderX is correct
- Restart both HBuilderX and WeChat Developer Tools
Q: WeChat Developer Tools preview shows white screen
Problem Description: White screen appears when previewing project in WeChat Developer Tools.
Solutions:
- Check console for error messages
- Try clearing WeChat Developer Tools cache: Settings -> Clear Cache
- Check if project configuration is correct, especially page paths in pages.json
- Check if APIs or components not supported by WeChat Mini Program are being used
Node.js and npm Related Issues
Q: npm dependency installation fails
Problem Description: Errors or timeouts occur when executing npm install
.
Solutions:
- Check if network connection is normal
- Try using domestic mirror source:
npm config set registry https://registry.npmmirror.com
- Clear npm cache:
npm cache clean --force
- Delete node_modules folder and package-lock.json file, then reinstall
Q: Node.js version compatibility issues
Problem Description: Some dependency packages require specific versions of Node.js.
Solutions:
- Use nvm (Node Version Manager) to manage multiple Node.js versions
- Switch to appropriate Node.js version based on project requirements
- Check dependency package documentation to understand supported Node.js version ranges
Vue CLI Related Issues
Q: Vue CLI project creation fails
Problem Description: Failure when creating uni-app project using Vue CLI.
Solutions:
- Ensure latest version of Vue CLI is installed:
npm install -g @vue/cli
- Check if there's sufficient disk space
- Try running command with administrator/root privileges
- If using proxy, check if proxy settings are correct
Q: Vue CLI created project cannot run
Problem Description: uni-app project created by Vue CLI reports errors when running.
Solutions:
- Check if dependency versions in package.json are compatible
- Ensure all dependencies are installed:
npm install
- Check if vue.config.js configuration is correct
- Check console error messages and troubleshoot based on specific errors
Other Environment Issues
Q: Real device debugging connection fails
Problem Description: Cannot connect to real device for debugging.
Solutions:
- Ensure phone and computer are on the same network
- Check if debugging settings are enabled on phone (e.g., Android Developer Options)
- Check if USB connection is normal, try changing USB cable or port
- Reinstall phone driver
Q: Simulator/Virtual machine fails to start
Problem Description: Android emulator or iOS simulator cannot start normally.
Solutions:
- Check if system resources are sufficient (CPU, memory, disk space)
- Ensure latest version of emulator/virtual machine is installed
- Check if virtualization technology is enabled in BIOS (Intel VT-x or AMD-V)
- For iOS simulator, ensure macOS system is being used
Q: Certificate configuration issues
Problem Description: iOS development certificate or Android signing configuration errors.
Solutions:
- Check if certificate has expired
- Ensure certificate matches developer account
- Regenerate and configure certificate
- Refer to official documentation for correct certificate configuration
Common Error Code Analysis
ERROR_INSTALL_FAILED
Problem Description: App installation to device fails.
Solutions:
- Check if device has sufficient storage space
- Uninstall old version of app from device
- Check if app signature is correct
- Check if device supports minimum system version required by app
ERROR_DEVICE_NOT_FOUND
Problem Description: Debug device not found.
Solutions:
- Reconnect device
- Ensure device has debugging mode enabled
- Update device drivers
- Try using other USB ports
Environment Configuration Best Practices
- Keep toolchain updated: Regularly update HBuilderX, Node.js, npm, and various dependency packages
- Use version control: Use Git or other version control tools to manage projects for easy rollback of problematic code
- Environment isolation: Create independent development environments for different projects to avoid dependency conflicts
- Documentation: Record environment configuration steps and encountered issues for team reference
- Regular cleanup: Regularly clean cache, temporary files, and unused dependency packages
If you cannot find a solution to your problem on this page, please check the uni-app official documentation or ask questions on the uni-app official forum.