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 triallee sharon
11,596 PointsError: module not found
hello, ive been getting an error when trying to run the app.js project file on my local computer for some reason.. can anybody please tell me what is it exactly and how can i fix it?
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module '/Users/leesharon/Desktop/Node-Basics-2017/app.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
thank you!
3 Answers
Mohamed Nuh
Full Stack JavaScript Techdegree Graduate 19,939 PointsFirst check if you installed node node -v. If that doesn't work you need to install it globally using npm install -g.
Ryan Tang
4,358 PointsIf you are working on the code in Visual Studio Code, you can try adding a configuration of "Node.js: Launch Program " by going to Run>Add Configuration, provided that you have a folder inside Visual Studio Code.
Victor Stanciu
Full Stack JavaScript Techdegree Student 11,196 PointsCheck if you are executing the right file. I got this error, for example, when executing node ap.js
instead of node app.js
James Ranish
1,801 PointsJames Ranish
1,801 PointsI'm getting the same thing, I've commented out every line one at a time and still get it.