I have a file name .env.development in the root folder. I had install env-cmd as dev dependencies
when I start the server
> npm run develop
its give me an error
> [email protected] develop I:learngatsby
> env-cmd .env-development gatsby develop
(node:1368) UnhandledPromiseRejectionWarning: Error: Unable to locate env file at default location (./.env)
at I:learngatsby
ode_modulesenv-cmddistget-env-vars.js:44:19
at Generator.throw (<anonymous>)
at rejected (I:learngatsby
ode_modulesenv-cmddistget-env-vars.js:5:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
(node:1368) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1368) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…