FAQ
Installation Issues
pnpm install fails
Make sure you are using the correct versions:
- Node.js >= 20.12.0
- pnpm >= 10.0.0
bash
node -v
pnpm -vIf using an older version, upgrade:
bash
npm i -g corepack
corepack enable
corepack prepare pnpm@latest --activatePort already in use
If the default port is occupied, you can modify the VITE_PORT in the corresponding app's .env.development file, or set it directly:
bash
VITE_PORT=3000 pnpm dev:nutuiDevelopment Issues
Mock server not working
Ensure VITE_NITRO_MOCK=true is set in .env.development. The mock server runs on port 5320 by default.
Auto-import not working
Run pnpm dev once to generate the auto-import type declarations. The generated files (auto-imports.d.ts, components.d.ts) should be committed to version control.
How to add a new page?
- Create a
.vuefile insrc/views/ - Add the route in
src/router/ - If the page needs a tabbar entry, update the layout configuration
How to add a new API endpoint?
- Create the API function in
src/api/ - If using mock data, add the mock handler in
apps/backend-mock/api/
Build Issues
Build out of memory
The root package.json already sets NODE_OPTIONS=--max-old-space-size=8192. If it's still not enough, increase the value.
How to deploy to a subdirectory?
Set VITE_BASE in .env.production:
bash
VITE_BASE=/my-app/Other
How to remove an unused UI framework app?
- Delete the app directory (e.g.,
apps/h5-varlet/) - Remove the corresponding scripts from root
package.json - Run
pnpm installto update the workspace
How to add a new shared package?
- Create a new directory under
packages/ - Add
package.jsonwith the@vh5/scope - Reference it in apps via
"@vh5/my-package": "workspace:*"