Error when git cloning a React & Vite & Typescript repo
Hi! So I tried to import this project that uses React, Vite and TS, but when I do I get this error everywhere and when I try to run the npm run dev command, it doesn't work properly...
Does anyone know how to fix this issue? Thank you!
8 Replies
in your package.json, in the
"scripts"
key, you dont have the "dev"
key
you need to check what the project has in that fileHave you installed dependencies?
i dont think he did
do you mean like doing ''npm create vite@latest'' and all?
if so, why would I need to do it again to clone a repo, cuz I did it when I first created the project on my other machine
the thing is that everything works fine on the original machine I created the app, but not on this one
you have to install all dependencies in the package.json, in ALL machines
also, the package.json has to be in the repo
ohh so if I add the package.json on github, then I won't need to install the dependencies?
because if I do install them each time, I'd have to go through the process, then delete every file except the package.json and THEN clone the repo if it still works
okay so what I did was the following:
clone the repo
open my console
npm create vite@latest
then targetted the folder I cloned from github
they told me it wasn't empty and I said to ignore its content, and it downloaded the node_modules, but it also added all the useless startup classes so now I have to delete the dupes
is that really the regular way of doing it?
why cant i just remove node_modules from git ignore and push on github the modules?