heroku-local icon indicating copy to clipboard operation
heroku-local copied to clipboard

why am i getting an error for heroku local web - f Procfile.windows ?

Open netisheth opened this issue 8 years ago • 10 comments

Hi, I am new to Heroku and I just started with their first tutorial Getting Started on Heroku with Java. I could implement all the steps successfully but i can't run the app locally. The build was successful.

C:\Users\my\Documents\GitHub\java-getting-started [master ≡]> heroku local web - f Procfile.windows

[OKAY] Loaded ENV .env File as KEY=VALUE Format [WARN] ENOENT: no such file or directory, open 'C:\Users\my\Documents\GitHub\jav a-getting-started\Procfile.windows' [FAIL] No Procfile and no package.json file found in Current Directory - See her oku local --help

Can someone please help me with it? Thank you in advance.

netisheth avatar Jul 26 '16 14:07 netisheth

does the Procfile exist in that location?

jdx avatar Jul 26 '16 17:07 jdx

Yes it's there.

netisheth avatar Jul 26 '16 17:07 netisheth

heroku local is just a wrapper for node-foreman: https://github.com/strongloop/node-foreman

maybe see if you can use node-foreman directly to rule out whether or not this is an issue with heroku local.

jdx avatar Jul 26 '16 17:07 jdx

I was experiencing a very similar error while trying to deploy my first app, which is written in python using the Flask framework.

I got the same failure message upon running heroku local, although I had a different [WARN] message(these warnings are just warnings though and aren't crashing heroku local):

[FAIL] No Procfile and no package.json file found in Current Directory - See her oku local --help

It turns out that I had incorrect syntax in my Procfile, and instead of saying the syntax in the Procfile was wrong, the error was just saying it can't find a procfile at all.

Specifics, in case they help

the command I run my app with is: gunicorn app:app

My Incorrect Procfile was: web gunicorn app:app

I was missing a colon after 'web', as the syntax is <process type>:<command>. Changing the Procfile fixed the problem: web: gunicorn app:app

Your situation is probably different. I would say just ensure your Procfile syntax is spot on, because apparently heroku local won't recognize the Procfile even exists if the syntax is incorrect.

wparrkerr avatar Aug 11 '16 05:08 wparrkerr

I did this and I still get the error. I've been trying to figure this out all day, but nothing. If I run "heroku local", it complains with the "[FAIL] No Procfile and no package.json file found in Current Directory - See run.js --help" error. If I run "heroku local web", it complains with this:

return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^

Error: EACCES: permission denied, open '.env' at Object.fs.openSync (fs.js:584:18) at Object.fs.readFileSync (fs.js:491:33) at loadEnvsFile (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/lib/envs.js:133:15) at Array.map (native) at loadEnvs (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/lib/envs.js:148:30) at Command. (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/nf.js:72:16) at Command.listener (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/commander/index.js:301:8) at emitTwo (events.js:106:13) at Command.emit (events.js:194:7) at Command.parseArgs (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/commander/index.js:615:12)

Please help!

grantathon avatar Jul 13 '17 14:07 grantathon

you're probably not in the right directory

jdx avatar Jul 13 '17 16:07 jdx

I have it in the same directory level as the project and app directories where manage.py is located, which I believe is correct.

grantathon avatar Jul 13 '17 21:07 grantathon

I've confirmed the same thing happens with the original heroku django template found here: https://github.com/heroku/heroku-django-template.

grantathon avatar Jul 13 '17 22:07 grantathon

You have not built your application locally and that is the reason you receive an error: there is no app startup script called from Procfile.windows.

To resolve the problem just run: sbt compile stage and voila... now you can run your app locally.

WojciechThomas avatar Sep 27 '17 09:09 WojciechThomas

i made a java rest api and is hosted nicely on heroku but some of the services says application error and also slow what could be the problem

marokac avatar Feb 16 '18 07:02 marokac