Creating a Project from Scratch.

·

1 min read

Firstly there will be three folders --:

Exercise

Files

Starter

Go into the exercise folder in the terminal and then run a command --> npm init -y

-->This command will create package.json in the exercise folder --> and that's all we need to run a node.js project.

Now we need to install vite and three.js and npm these dependencies inside it.

Installing Vite Dependency

Now we need to add the vite dependency so for that we will run another command in the terminal --> npm install vite --> two new files will be created named --> 1) node_modules and 2) package-lock.json --> many folders will be there in the node_modules folder

In the package.json file in the scripts part there will be like this

We will remove the text written in the scripts, it is the text which comes by default --> we will change it like this

After this we will run another command in the terminal --> npm run dev --> This command will create a local host for you

In the HTML file in the scripts write type=module and then src=script.js

If you don't add type=module attribute it will not work.

That's it for today. See you in the next part.