Error: ENOENT: no such file or directory, open '.env'] errno: -2, code: 'ENOENT', syscall: 'open', path: '.env'
See original GitHub issueHi there!
I’m doing my first app using keystonejs and docker. It runs local and in my local docker as well, no problem at all.
But when i try to deploy that docker image to a server, i’m getting a new error.
`Error: ENOENT: no such file or directory, open ‘.env’] errno: -2, code: ‘ENOENT’, syscall: ‘open’, path: ‘.env’``
I had to use keystonejs version 0.4 (master) because of another error:
If i remove var dotenv = require('dotenv');
in the beginning of the keystone.js , it do not shows me this
`Error: ENOENT: no such file or directory, open ‘.env’] errno: -2, code: ‘ENOENT’, syscall: ‘open’, path: ‘.env’`` message. But the log is the same (just without that line)
Any ideas?
Thanks
npm ERR! /opt/app/npm-debug.log
npm ERR! Please include the following file with any support request:
npm ERR! There is likely additional logging output above.
npm ERR! npm owner ls mysite
npm ERR! You can get their info via:
npm ERR! node ./app.js
npm ERR! Tell the author that this fails on your system:
npm ERR! not with npm itself.
npm ERR! This is most likely a problem with the mysite package,
npm ERR! Failed at the mysite@1.0.0 start script 'node ./app.js'.
npm ERR!
npm ERR! Exit status 137
npm ERR! mysite@1.0.0 start: `node ./app.js`
npm ERR! code ELIFECYCLE
npm ERR! npm v2.14.7
npm ERR! node v4.2.3
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! Linux 3.13.0-48-generic
npm info mysite@1.0.0 Failed to exec start script
Killed
development
Environment for Node Process
{ [Error: ENOENT: no such file or directory, open '.env'] errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
> node ./app.js
> mysite@1.0.0 start /opt/app
npm info start mysite@1.0.0
npm info prestart mysite@1.0.0
npm info using node@v4.2.3
npm info using npm@2.14.7
npm info it worked if it ends with ok
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Error: ENOENT: no such file or directory, open '.env' · Issue #135
the solution is to use the terminal, run touch .env in your project root folder, a new .env file will be created and...
Read more >Heroku node.js - no such file or directory, open '.env'
Sounds like somewhere in your code you are trying to open the .env file. You should not be doing that. To access an...
Read more >no such file or directory, open '/usr/app/package.json' CI error ...
as you see i'm already wrote COPY package*.json /usr/app/ when i'm try to run docker-compose run bona_api ls it only returns node_modules.
Read more >Webpack: can't analyze config when using DotenvPlugin
Webpack: can't analyze config when using DotenvPlugin ... stderr: { Error: ENOENT: no such file or directory, open './.env' at Object.fs.
Read more >How to Fix npm ERR Code ENOENT npm ERR syscall Open ...
... ENOENT npm ERR syscall Open Error or ENOENT No Such File or Directory ... Folder Which is The Main Folder of Project...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Add more memory to your AWS instance!
Sorry guys, it was a problem in my AWS, where has a limited RAM memory. So if you got killed without a warn or error message… now you know =)