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

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


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

How to fix npm ERR! missing script: “start” error in node js is shown


Content

0.72 -> hey hello everyone in this video i'll be showing  you how to solve the error npm err missing script  
6.4 -> start so i get this error when i try to start my  node server by typing the command npm start okay  
12.16 -> so these are the files that i have over here my  main.js file is the file where i have my normal  
16.8 -> code okay connection schema and all this app.post  okay and these are the default files we'll be  
22.4 -> getting package lock json and package.json so  the first thing what you do is you need to check  
27.12 -> whether you are inside the right folder itself so  currently nmp is my folder and within this folder  
32.64 -> i'm having my js files dot json files and as well  as node modules so you need to check whether you  
38.88 -> are in that particular folder in your terminal  as well so here i am perfectly in this folder  
43.12 -> but you need to check for you so after checking  that you need to go inside your package.json file  
48.72 -> okay so if you aren't having this package.json  file you need to type npm init in your terminal  
54.8 -> okay you will be getting this file so once you  are inside this file you will be having like  
58.56 -> this okay you will be at first you will be having  name version description dependencies and if you  
62.96 -> just scroll down you will be having the scripts  okay and within the scripts what you are doing is  
69.04 -> just come inside this within the curly bracket  just put double quotes you are going to type  
75.2 -> start okay and you will be automatically getting  this double quotes and comma over here and inside  
80.48 -> this you need to put node your main dot js file  (starting file) or the file that you have you  
85.68 -> are like the important code okay for me i'm just  having one dot js file so this is the name of my  
90.88 -> file so it can be like any other name so i'm just  going to put that okay main.js and this file can  
97.84 -> be like any name i have just named it main okay  so simple just type start put inside double quotes  
105.04 -> put node this is a keyword and your  like important dot js file over here  
109.84 -> okay so after doing this important thing save it  okay otherwise it won't work so saving it control  
115.44 -> s so now we are good to go so now if i just go  to the same terminal if I just put npm start
124.8 -> so as you can see here now it is trying to start  and i think we'll be getting on some port i  
130.24 -> guess so let me just scroll down yeah it's three  thousand five and we need to get three thousand  
135.36 -> five yeah here you can see i'm getting on port  3005 which means that my node server is working  
140.4 -> fine and i'm not getting any errors now okay so  i hope you would have found this video useful  
145.36 -> mine's a programming channel i've done many  videos in c c plus plus java as well as  
148.64 -> i've also done this entire tutorial okay post  put get and delete fetch and delete by using  
154.24 -> node.js and mongodb you can also watch that video  so subscribe and support me thanks for watching

Source: https://www.youtube.com/watch?v=FlcDDUiW7Dg