I'm trying to pass some env
variables to a child process started using forever monitor, The problem is that I'm unable to load them from my custom .env file and pass to the child process.
This is my index.js script
#!/usr/bin/env node
require('dotenv').config();
const forever = require('forever-monitor');
const path = require('path');
const script = path.format({dir: __dirname, base: 'pager.js'});
const child = new (forever.Monitor)(script, {
max: 2,
silent: false,
env: {'EMAIL': process.env.EMAIL, 'MPWD': process.env.MPWD}
});
//debug dotenv
console.log(process.env)
child.start();
How I can fix, maybe I'm doing something wrong?