env-cmd
env-cmd copied to clipboard
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
The script from package.json
...
"use:local": "env-cmd -f \".env.local\"",
...
yarn use:local
yarn run v1.22.10
$ env-cmd -f "./.env.local"
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
at validateString (internal/validators.js:124:11)
at normalizeSpawnArguments (child_process.js:411:3)
at Object.spawn (child_process.js:551:13)
at Object.spawn (/Users/accounts-services/node_modules/cross-spawn/index.js:12:24)
at Object.EnvCmd (/Users/accounts-services/node_modules/env-cmd/dist/env-cmd.js:59:26)
at async Object.CLI (/Users/accounts-services/node_modules/env-cmd/dist/env-cmd.js:19:16) {
code: 'ERR_INVALID_ARG_TYPE'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
the .env.local
from same directory
DATABASE_URL="postgresql://user:password@localhost:5432/main?schema=public"
# AWS CREDENTIALS
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=......
AWS_REGION=us-west-1
PASSWORD_KEY=internal-dev-password-key
JWT_SECRET_KEY=internal-dev-jwt-secret-key
# SLACK BOT HOOK KEYS
SLACK_BOT_TOKEN=your-testing-bot-token
SLACK_AQUISITION_NOTIFICATIONS_CHANNEL_ID=C022DJ74CJD
#GITHUB CLIENT VALUES
GITHUB_CLIENT_SECRET=add-your-test-github-client-secret
GITHUB_CLIENT_ID=12345678;
# NODE_ENV
NODE_ENV=development
I am having the same issue, any update on this?
I am having the same issue, any update on this?
did you?
I'm having the same issue
I'm having this issue as well
Also having this issue.
Okay guys, I have the answer.
env-cmd -f .env.staging react-scripts build
env-cmd -f <my env file path> <commands for env>
We are assuming that env-cmd -f .env.staging
works alone. However, you have to specify a command after it to which the environment applies.
Okay guys, I have the answer.
env-cmd -f .env.staging react-scripts build
env-cmd -f <my env file path> <commands for env>
We are assuming thatenv-cmd -f .env.staging
works alone. However, you have to specify a command after it to which the environment applies.
Thanks, i almost lost my mind because I used it with &&
like env-cmd -f .env.staging && react-scripts start