npm ERR! Missing script: "dev" #79127
-
|
Hi! I'm trying to create a React project with Vite. The project folder is ready, npm installed, the package.json file is fine, and it includes the necessary lines, such as: |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 19 replies
-
|
@felyan I would recommend you remove your |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
I'm having the same issue but in my case, after running npm install, it is not creating the node_modules folder nor the package-lock.json file. |
Beta Was this translation helpful? Give feedback.
-
|
Okay, my problem was actually quite simple to resolve, because I was making a mistake. In my case I was entering the command npm create vite@latest and npm install without first entering the vite-project folder, where I should have run npm install and then npm run dev. |
Beta Was this translation helpful? Give feedback.
-
|
I am having the same issue with Vite and it broke my project. Some things I have done:
Whatever I do I get the following errors when trying Help is appreciated! |
Beta Was this translation helpful? Give feedback.
-
|
Npm run dev returns: npm ERR! A complete log of this run can be found in: C:\Users\aidoj\AppData\Local\npm-cache_logs\2024-03-08T13_47_41_707Z-debug-0.log C:\Users\aidoj\OneDrive\Desktop\react2>` while my JSON seems correct. I am baffled.
|
Beta Was this translation helpful? Give feedback.
-
how would you get the solution because i m suffering from the same |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Sometimes it happens due to being in the wrong directory. Ensuring to run "npm install" after modifying the package.json may help to resolve it. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
I'm a 'rookie', but this same issue occurred to me in a backend test, before any framework, I mean, when I was testing the Express server. I tried almost all the suggestions above, but I think that what solved the problem was simple "npm init -y". Hope it helps. |
Beta Was this translation helpful? Give feedback.
-
|
Hey so guys if it's not working for you then, i will tell you what i did, i just deleted node modules, package.json, and package-lock.json. Then i type the command, npm init -y then install dependencies and for nodemon i type, npm i nodemon -D. Then i typed the npm run dev and it started to work. Hopefully someone will find this helpful. |
Beta Was this translation helpful? Give feedback.




If you fully followed this guide up to facing this issue. https://vitejs.dev/guide
I would recommend you reinstall your node and check all stuff after re-installation. I expected after the re-installation of your vite globally, it would work fine.