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

no such file or directory, open '.env' #8

Open
pavankat opened this issue Dec 4, 2017 · 2 comments
Open

no such file or directory, open '.env' #8

pavankat opened this issue Dec 4, 2017 · 2 comments

Comments

@pavankat
Copy link

pavankat commented Dec 4, 2017

I updated the secrets file with my postgres credentials.

However, I get a warning when starting up the app. Any ideas? It works.

{ Error: ENOENT: no such file or directory, open '.env'
    at Object.fs.openSync (fs.js:583:18)
    at Object.fs.readFileSync (fs.js:490:33)
    at Object.config (/Users/pavankatepalli/Desktop/git/node/mine/cryptofigure/node_modules/dotenv/lib/main.js:30:37)
    at Object.<anonymous> (/Users/pavankatepalli/Desktop/git/node/mine/cryptofigure/app.js:7:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10) errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
@Rob-Rychs
Copy link

Rob-Rychs commented Dec 17, 2017

Hey @pavankat just rename the file sample.env in the repo to .env and you can include your secrets in there...

Quick question for you, if you added postgres to the config/secrets.js how did you get your URL? to replace for example 'postgres://yhnavein:[email protected]/prod'; on line 143 in config/secrets.js

Could you also explain anywhere else you added postgres credentials?

Thanks!
😀

is this URL mean postgres://user:password@localhost/db_name? clearly no local user yhnavein, sorry not the best with postgres + sequelize!
image

@Rob-Rychs
Copy link

Rob-Rychs commented Dec 21, 2017

Got this all working fine now. If the db gives anyone else trouble at first just change the 'postgres://yhnavein:[email protected]/prod'; to 'postgres://@localhost:5432/prod' for running local in dev and then run createdb prod, start postgreSQL servers and you can connect to the db on port 5432

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

2 participants