npm err missing script start solved | Npm start not working in node js

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey hello everyone in this video i'll be showing  you how to solve the error npm err missing script   start so i get this error when i try to start my  node server by typing the command npm start okay   so these are the files that i have over here my  main.js file is the file where i have my normal   code okay connection schema and all this app.post  okay and these are the default files we'll be   getting package lock json and package.json so  the first thing what you do is you need to check   whether you are inside the right folder itself so  currently nmp is my folder and within this folder   i'm having my js files dot json files and as well  as node modules so you need to check whether you   are in that particular folder in your terminal  as well so here i am perfectly in this folder   but you need to check for you so after checking  that you need to go inside your package.json file   okay so if you aren't having this package.json  file you need to type npm init in your terminal   okay you will be getting this file so once you  are inside this file you will be having like   this okay you will be at first you will be having  name version description dependencies and if you   just scroll down you will be having the scripts  okay and within the scripts what you are doing is   just come inside this within the curly bracket  just put double quotes you are going to type   start okay and you will be automatically getting  this double quotes and comma over here and inside   this you need to put node your main dot js file  (starting file) or the file that you have you   are like the important code okay for me i'm just  having one dot js file so this is the name of my   file so it can be like any other name so i'm just  going to put that okay main.js and this file can   be like any name i have just named it main okay  so simple just type start put inside double quotes   put node this is a keyword and your  like important dot js file over here   okay so after doing this important thing save it  okay otherwise it won't work so saving it control   s so now we are good to go so now if i just go  to the same terminal if I just put npm start so as you can see here now it is trying to start  and i think we'll be getting on some port i   guess so let me just scroll down yeah it's three  thousand five and we need to get three thousand   five yeah here you can see i'm getting on port  3005 which means that my node server is working   fine and i'm not getting any errors now okay so  i hope you would have found this video useful   mine's a programming channel i've done many  videos in c c plus plus java as well as   i've also done this entire tutorial okay post  put get and delete fetch and delete by using   node.js and mongodb you can also watch that video  so subscribe and support me thanks for watching
Info
Channel: United Top Tech
Views: 60,519
Rating: undefined out of 5
Keywords: missing script start node js, npm err missing script start
Id: FlcDDUiW7Dg
Channel Id: undefined
Length: 2min 39sec (159 seconds)
Published: Tue May 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.