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 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
10,933 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?

2 Answers

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