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 trial

JavaScript Node.js Basics 2017 Building a Command Line Application Making a GET Request with https

Error: 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!

I'm getting the same thing, I've commented out every line one at a time and still get it.

3 Answers

If 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.