Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Asynchronous Programming with JavaScript Understanding Promises Reject a Promise and Handle Errors

Problem launching the files on node command - Reject a Promise.

Hi there, I have problems launching using node command on VS Code as well as on the Treehouse Workspace. I tried even with the console, adding the <script> in index.html as advised in the teacher's notes.

PS C:\Users\marni\OneDrive\Skrivbord\CV & Letters\asynchronous-programming-with-javascript\asynchronous-programming-with-javascript\3- Understanding Promises\2-create-a-promise> node promises-breakfast.js
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Users\marni\OneDrive\Skrivbord\CV & Letters\asynchronous-programming-with-javascript\asynchronous-programming-with-javascript\3- Understanding Promises\2-create-a-promise\promises-breakfast.js'     
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)      at node:internal/main/run_main_module:17:47 {  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v17.4.0
PS C:\Users\marni\OneDrive\Skrivbord\CV & Letters\asynchronous-programming-with-javascript\asynchronous-programming-with-javascript\3- Understanding Promises\2-create-a-promise>   
Lasse Grosbøl-Rais
Lasse Grosbøl-Rais
9,365 Points

Hello, fellow scandinavian. I would love to help you (if you still need it). Can you send me your code and tell me what you want it to do?

1 Answer

Hi Lasse, thanks for replying. It is good for now.