Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File not found #61

Closed
elie222 opened this issue May 8, 2019 · 5 comments
Closed

File not found #61

elie222 opened this issue May 8, 2019 · 5 comments

Comments

@elie222
Copy link

elie222 commented May 8, 2019

This is a bug in the latest version of this package. Works fine with 8.0.2, but not with 9.0.1.

I have a Create React App and run this command:

    "build:test": "env-cmd .env.test yarn run build",

I get the following error:

spawn .env.test ENOENT
/bin/sh: line 1: 58663 Hangup: 1               env-cmd .env.test yarn run build
@g1aurav
Copy link

g1aurav commented May 8, 2019

@elie222 I faced the same issue earlier today, after updating env-cmd to 9.0.1. I was able to make it work by downgrading my node version from 10.5.0 to 8.15.0

@toddbluhm
Copy link
Owner

toddbluhm commented May 8, 2019

The options have changed in v9. You need to pass the -f flag if you want to provide a custom env file path (by default with no -f flag it looks for ./.env file). I will update the Readme to make that more apparent. Thanks for bringing this up. It was not a change I made lightly, but was necessary to better future proof the lib.

@leefernandes
Copy link

When specifying a -f with relative path, should it be relative to the ./node_modules/env-cmd/... directory, or the project working directory?

@toddbluhm
Copy link
Owner

It should be relative to where you executed the script from (so working directory).

@toddbluhm
Copy link
Owner

Closing due to inactive/no response from original poster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants