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
Step 1: First run the command: npm install --save-dev env-cmd@10.1.0
npm install --save-dev env-cmd@10.1.0
Step 2: Replace env-cmd .env-development gatsby develop with ./node_modules/.bin/env-cmd -f ./.env.development gatsby develop
env-cmd .env-development gatsby develop
./node_modules/.bin/env-cmd -f ./.env.development gatsby develop