1
votes

D:\nodeP>node main.js module.js:327 throw err; ^ Error: Cannot find module 'D:\nodeP\main.js' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Function.Module.runMain (module.js:441:10) at startup (node.js:139:18) at node.js:968:3

I am getting this error. Don't know what to do. can anyone help me out please. I have set my environment variable path correctly. please help me out. I have downloaded on the Windows 10 System. and i am getting this error on the CMD . TIA

1
It simply says that there is no file D:\nodeP\main.js. - user6586783

1 Answers

0
votes

you're trying to run main.js file but the file does not exist in the nodeP folder.

Make sure that the file is in the right folder, or that your CMD is looking in the right folder. You can change your location with

>cd folderName 

or

>cd .. 

to go one step back

Also make sure that your node application has the right name. Most common names are server.js or app.js if you're following a tutorial.