0

Whenever I type node . in terminal, (I'm using Visual Studio, idk if that matters) it gives me this error:

  throw err;
  ^

Error: Cannot find module './config'
Take12
  • 21
  • 1
  • 3

1 Answers1

0

For issues related to the terminal, try to install npm locally, it might solve the problem.

(or)

You can make the directory root of your project, as explained in this link

For issues related to compilation, you need a proper way to reference files relative to application root in Node.JS

Example: config = require('../config/config');

The folder named .. is the parent folder helps in making the path to the file, which means we can go up for two levels with this ../

When you compare (.) and (..) , (.) means current location where as .. means two levels up above the current one.

also,

Try checking ./Config with Caps instead of ./config

Abhishek Duppati
  • 610
  • 6
  • 18