Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmohamed adam
Full Stack JavaScript Techdegree Student 11,884 Pointsnpm start doesnt work
i do not why this express workshop files dont work for me when i npm start. this is the error i get. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\64204\AppData\Roaming\npm-cache_logs\2020-08-04T06_57_01_033Z-debug.log
2 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsHi Mohamed.
You may need to check that npm is installed for your project either globally so you can use it for your project or that the projects JSON file is included for your project.
You can check npm is ready by typing npm -v
in your terminal.
Also in the root of your project you can make sure the project dependencies are correctly installed using npm install
.
Let us know if this helps! :-)
James Crosslin
Full Stack JavaScript Techdegree Graduate 16,882 PointsI'm also getting an error when I attempt to run this project. I know why, however.
package.json for the project
{
"name": "express-template",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "nodemon ./bin/www"
},
"dependencies": {
"debug": "~2.6.9",
"express": "~4.16.1",
"morgan": "~1.9.1",
"pug": "^2.0.4"
}
}
This start script requires nodemon but it is not listed in the dependencies. I purposely do not install dependencies like nodemon to my root, since this is a security risk. Adding nodemon to the dependencies would probably be a good idea.
For those facing the same issue, run
npm install -D nodemon
and you should be good to go.
mohamed adam
Full Stack JavaScript Techdegree Student 11,884 Pointsfirst i downloaded the files and on project root i did npm install after that i npm start and that is when get the error.
Simon Coates
8,377 PointsSimon Coates
8,377 PointsI initially got an error, but it was because I was in the wrong directory to run the command. In the right directory, I was able to run npm install. But I got an error on npm start. I had to manually run 'npm install nodemon --save' and then things worked as expected. (In the event you resolved this weeks ago, I thought it might be applicable to other people who have errors)