1
votes

I am new to Node.js and I am trying to run my test files via Node.js. I am simply typing "node .\tut63.js" but it is showing the following error:

Error: Cannot find module 'C:\Users\User11\Desktop\Complete Web Developement Bootcamp\tut63.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

I am simply running a "console.log("HelloWorld");" as my test .js file

3
Can you provide the file contents? Your question is not meaningful if you try running tut63.js and your file name is test.js.hacKaTun3s

3 Answers

0
votes

Your file is called "test.js", right? Try running:

node test.js
0
votes

If your file name is test.js then you need to navigate to the directory where your project is in the terminal. Then run node test.js. Hop it works

0
votes

Could also be related to a broken node installation. Try reinstalling it completely. You can also try to remove npm completely at %AppData%\npm\node_modules before reinstalling everything (related, but not Windows: Node MODULE_NOT_FOUND)