-1

So I am trying to make my procfile for Heroku CLI but I don't think Heroku is recognizing it because when I do $ git push heroku main the Procfile doesn't work rather it does npm start rather than what's written in the Procfile but it works when I run it locally like heroku local --procfile=procfile. And I'm pretty sure that the P of my profile is correct so that's not the issue

When I do $ git push heroku main ( Updated ): https://i.stack.imgur.com/gGcSZ.png

When I do $ heroku local --procfile=procfile https://i.stack.imgur.com/BErzz.png

Folder Pic: https://i.stack.imgur.com/blHei.png

Procfile : worker: node index.js

Full git view + commiting :- https://i.stack.imgur.com/KYOHw.png

package.json :

  "name": "ban-counter",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "discord.js": "^13.6.0"
  }
}
Arya
  • 1
  • 1
  • "I'm pretty sure that the P of my profile is correct"—I suspect it isn't: You've used both `Procfile` and `procfile` in your question (as well as `Heroku local` when it should be `heroku local`), and you're explicitly telling the CLI what to use as the `Procfile` via the `--procfile` argument. Is your file called `Procfile` or `procfile`? I'm betting the latter, and furthermore I'm betting you're on Windows. – ChrisGPT was on strike Apr 27 '22 at 17:19
  • that was autocorrect when I wrote in question .... I am 100% sure my P in `Procfile` is correct and Heroku too its Grammarly autocorrect ... also the `--procfile` you mentioned while using heroku local is according to a guide on Heroku ... https://devcenter.heroku.com/articles/heroku-cli-commands – Arya Apr 27 '22 at 17:32
  • Don't blame autocorrect. It is your job as a question asker to make sure you provide accurate information. Turn it off, manually fix its changes, whatever you have to do to make your question clear. We can't be expected to guess at which errors are relevant and which are typos. – ChrisGPT was on strike Apr 27 '22 at 17:34
  • ;-; ok i fixed the autocorrect thingy ( my fault ) but now can you please tell how to fix this issue so that when i do `git push heroku main` it takes whats in procfile as the code runner rather than default `npm start` – Arya Apr 27 '22 at 17:37
  • YEA man its called Procfile i have made projects in past with Procfile ... – Arya Apr 27 '22 at 17:37
  • my package.json has discord.js library in it – Arya Apr 27 '22 at 17:38
  • becuz its in heroku CLI commands guide and it is even working – Arya Apr 27 '22 at 17:46
  • then what do I do ... how do i make Procfile work with `$ git push heroku main` I dont wanna just run it locally – Arya Apr 27 '22 at 17:49
  • [Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/354577), and please include all output above "Release v3 created"—it contains useful information, including whether your `Procfile` is named with the wrong case (which I still suspect). – ChrisGPT was on strike Apr 27 '22 at 17:49
  • "how do i make Procfile work with `$ git push heroku main`"—by naming it correctly and putting it in the right place. You still have not shown that you've done this. Show the output of `ls` or a screenshot of your project's root directory. – ChrisGPT was on strike Apr 27 '22 at 17:51
  • Thank you. Now, is that file committed? What is the name of the branch you are trying to deploy? And what does Heroku tell you above "Release v3 created" when you push? – ChrisGPT was on strike Apr 27 '22 at 17:54
  • man I posted the pic of my folder so you can check my Procfile posting ls gimme 1 sec multitasking – Arya Apr 27 '22 at 17:54
  • it gives me a error cuz it freakin runs `npm start` whereas its supposed to run `node index.js` which is in Procfile – Arya Apr 27 '22 at 17:57
  • You continue to post screenshots of text. _Again_, [please don't do that](https://meta.stackoverflow.com/a/285557/354577). Paste as _text_ into your question, then select and click the `{}` button or press Ctrl+K to format as a code block. – ChrisGPT was on strike Apr 27 '22 at 19:00
  • That last screenshot says "Your branch is ahead of 'origin/main' by 5 commits", but then `git push heroku main` says "up to date". Please show a graphical view of your commits and branches, e.g. via `gitk --all` or whatever other tool you prefer. Show all branches, please. – ChrisGPT was on strike Apr 27 '22 at 19:02
  • I already fixed the issue just had to add `"start": "node index.js"` to the scripts in the package.json ez – Arya Apr 28 '22 at 21:38
  • That's not a fix, it's a workaround. – ChrisGPT was on strike Apr 28 '22 at 21:52

1 Answers1

0

Just had to add "start": "node index.js" to the scripts in the package.json therefore now resulting in:

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
     start": "node index.js"
  },
Arya
  • 1
  • 1