fix(config): add a bolder warning when missing .env (#43979)
This commit is contained in:
committed by
GitHub
parent
fa8b2693ad
commit
f5ccaf971b
@ -4,12 +4,16 @@ const envPath = path.resolve(__dirname, '../.env');
|
|||||||
const { error } = require('dotenv').config({ path: envPath });
|
const { error } = require('dotenv').config({ path: envPath });
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
if (process.env.FREECODECAMP_NODE_ENV === 'development') {
|
console.warn(`
|
||||||
console.warn('.env not found, please copy sample.env to .env');
|
----------------------------------------------------
|
||||||
} else {
|
Warning: .env file not found.
|
||||||
console.warn(`.env not found. If env vars are not being set another way,
|
----------------------------------------------------
|
||||||
this could be a problem.`);
|
Please copy sample.env to .env
|
||||||
}
|
|
||||||
|
You can ignore this warning if using a different way
|
||||||
|
to setup this environment.
|
||||||
|
----------------------------------------------------
|
||||||
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
Reference in New Issue
Block a user