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

Harshavardhan Gangavarapu
Harshavardhan Gangavarapu
13,727 Points

can't fix the error

const breakestPromise=new Promise((resolve,reject)=>{
    setTimeout(()=>{
        resolve("Your order is ready. Come and get it!");
    },3000);
});

console.log(breakestPromise);
breakestPromise.then(val=>console.log(val));

This is the code i wrote, and i encountered an error while executing this file using node:

PS C:\Users\welcome\Desktop\Harsha programs> node promises-breakfast.js internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'C:\Users\welcome\Desktop\Harsha programs\promises-breakfast.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Please help me fix this error

Harshavardhan Gangavarapu
Harshavardhan Gangavarapu
13,727 Points

This is while i was doing the asynchronous programming with javaScript

Teacher: Guil

Harshavardhan Gangavarapu
Harshavardhan Gangavarapu
13,727 Points

Even in the treehouse workspaces, i encounter the same error

Steven Parker
Steven Parker
229,732 Points

Make a "snapshot" (the camera icon) of your workspace and then post the link it gives you here. That will allow us to replicate the environment and examine the issue.

1 Answer

varlevi
varlevi
8,113 Points

From the info you've given, I would guess that you've linking to a file incorrectly, but I can't say for sure. I would recommend checking all your links to external files. Hopefully this helps!