Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 0.4 — Set Up Your Computer
3D Web · Example 1 of 1

The src/main.js you run on your computer

The same file works on this page and in your Vite project. On your computer the import finds three.js in node_modules.

Install Node.js, open a terminal, create a Vite project called lumen-3d, add three.js 0.186.1, start the dev server and see your cube in the browser. Every command has its real output, and every common failure has a fix.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 4 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Create the lumen-3d project, pin three.js 0.186.1, replace main.js with the example and get the turning cube on your screen. Write down the exact address your dev server printed.

02

Your friend's terminal says npm error Missing script: "dev". Give two possible causes and how to check each.

Explain it without notes

01

Why do we need a dev server at all? Why not open index.html directly?

02

What is the difference between npm install three@0.186.1 and npm install --save-exact three@0.186.1?

The src/main.js you run on your computer
Press Run to see the page.
idle

Console

Nothing logged yet.

Expected console output

three.js 186 is working