1

Please someone help me. I am new to nodejs.

I am Getting the following error while run node program. I tried no of solutions from the net but all failed eg. uninstalled node and reinstalled. Current version I am using Current version 14.5.0.

internal/modules/cjs/loader.js:1033
  throw err;
  ^
Error: Cannot find module 'E:\work\ngwork\angularauth\server\server'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
    at Function.Module._load (internal/modules/cjs/loader.js:899:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
3
  • 1
    Show us some of your code Commented Jul 5, 2020 at 9:40
  • You did npm install and installed all modules of that program ? Commented Jul 5, 2020 at 9:47
  • Although I have installed all the needed modules by giving "npm install --save express body-parser " command while I am inside current directory on the terminal. server.js file has only one statement which is "console.log('Hello world')". Commented Jul 6, 2020 at 5:05

1 Answer 1

1

This error means that you are trying to run your server.js from a folder that doesn't contain it, to solve this look in the folder pallet normally it's on the left in your IDE and locate the server.js file and then check the root folder where this file is located, after that access the folder from terminal if you are savvy with terminal commands or you can locate the folder in your computer and then open the folder from your IDE so that you will be able to access the files in the folder

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Sven.hig, I re-checked the folder structure and I found server.js file outside my current directory. Thanks for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.