Try:
npm run start
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
While running npm start, terminal throws an error "missing script: start" even when I have already added the "start" into the script part. I am not able to see the output of Application.
This question is related to the following Learning Module
Try:
npm run start
Hi HemLata Sharma,
Thank you for reaching out to us on MS Q&A forum.
As the Bruce (SqlWork.com) suggested, try running npm run start
instead. Sometimes, npm start
might not work as expected. Using npm run start
can often resolve the issue.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.
This kind of error I am receiving. I had inserted start in the script already, but still, it is showing this. Kindly check.
Hi HemLata Sharma,
The difference between the two scenarios when running npm start
lies in the location of the package.json
file:
Scenario 1 (Correct Path):
C:\Users\Quadrant\Desktop\varun\node-essentials\node-dependencies\3-final-solution-exercise-package-json\package.json
3-final-solution-exercise-package-json
) that contains the package.json
file. When you execute npm start
, npm checks the package.json
file in the current directory for a start script. Since the package.json
here includes "start": "node ./src/index.js"
in its scripts section, npm runs node ./src/index.js
as instructed. This results in the expected output, such as "Welcome to this application!". Scenario 2 (Incorrect Path):
C:\Users\Quadrant\Desktop\varun\node-essentials\node-dependencies\package.json
node-dependencies
) that contains the package.json
file. When you run npm start
, npm looks for the start script within the package.json
file in the current directory (node-dependencies
). However, the package.json
in this directory does not define a start script or any other scripts. Therefore, npm cannot find the start script it needs to execute and reports an error stating "Missing script: 'start'".Summary:
npm start
executes successfully when you run it from the directory containing the relevant package.json
file with a defined start script.npm start
from a directory where package.json
either does not exist or does not specify a start script, npm will fail with an error indicating that the expected script is missing.To ensure npm start
works correctly, always run it from the directory where the corresponding package.json
file resides and includes the necessary script definitions.
If you encounter any future issues, please feel free to contact us, and we will be pleased to assist you further.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.