Error - cannot find module 'config'

I have a mail configuration code in all.js.

Now I am trying to import this into my service mail.js, so I imported the module configas follows: -

mail.js

config = require('config'),

all.js

mailer: {
        auth: {
            user: "XXXXXXX",
            pass: "abc@123"
        }
    }

enter image description here

Gives me an error, I can’t find the module, but the module exists, I checked it.

How to solve this?

+4
source share
1 answer

I used the following code and it worked: -

config = require('../config/config');
+4
source

Source: https://habr.com/ru/post/1525590/


All Articles