- Node.js v16 or higher: https://nodejs.org/
- Basic knowledge of npm / git
git clone https://github.com/Adjam93/threejs-model-viewer.git
cd threejs-model-viewernpm installnpm run buildThis will build the code into the dist directory.
npm run startOpen the browser at http://localhost:3000
If successful, the viewer interface will be shown in the browser. Try loading a .gltf or .glb model.
| Error | Cause | Solution |
|---|---|---|
npm install error |
Node.js version too low | Upgrade to version ≥16 |
Error: port in use |
Port (3000) is occupied | Change port in package.json or kill the process using the port |
| Model not loading | Incorrect resource path | Check .gltf/.glb link in the code |
git clone→ Get the source code.npm install→ Install dependencies.npm run build→ Build intodistdirectory.npm run start→ Run in the browser.