Monorepo on Heroku getting "bash: node: command not found" error - heroku

I have a monorepo for which I am trying to deploy a package on Heroku. I have set up the buildpack https://github.com/heroku/heroku-buildpack-multi-procfile and added the PROCFILE config.
My procfile has the following type:
web: node index.js
When my app starts I get the error:
bash: node: command not found
I've tried adding the node buildpack in addition to the multi-procfile but that doesn't work either.

Related

Heroku won't recognize Procfile in dynos at dashboard

Im trying to host my object detection api on heroku but i can't due to it not recognizing my
Procfile, which is a file and not a text file. the way its spelled is Procfile, its contents are
web:gunicorn app:app
the way i know that its the Procfile thats the problem is because when i run bash and look at the root directory of the heroku git i see Procfile but when i look at the logs i see that no web process is running and on the dashboard the dynos is completely empty.
i've tried doing
web: gunicorn app: app instead of web:gunicorn app:app
to no avail, i've made sure that gunicorn is in the requirements.txt and know that its pip installing the requirements.txt as the cmd tells me that it is when i do git push heroku master. i've tried doing echo>Procfile and then modifying the contents of the file. i've tried both echo "web:gunicorn app:app"> Procfile and echo web:gunicorn app:app>Procfile i tried doing heroku ps:scale web=1 and get Scaling web dynos... failed ! No such process type web defined in Procfile. and when i do heroku ps i get nothing

Heroku Discord Bot builds but doesn't work

I am trying to host a discord bot on Heroku (Discord JDA, Maven). I do this by connecting to Github and then deploying. The bot 'deploys' (view attachment) but doesn't actually work (view attachment).
What could I be doing wrong, or has anyone else come across a similar issue?
Quick and dirty way to deploy it:
You'll need to setup a Procfile, extensive info on that right here: https://devcenter.heroku.com/articles/procfile
The procfile is basically a file with no extension that tells the dyno how to execute your program.
A simple
worker: java $JAVA_OPTS -jar <PATH_TO_JAR>
will work fine if you don't need more config, refer to that link for more.
You can then deploy it like this (Good to have procfile and jar on the same directory):
$ heroku deploy:jar -a <YOUR_HEROKU_APP_NAME> --jdk <JDK_VERSION> --jar <PATH_TO_JAR> -i Procfile
Then to start it just do (Assuming you want a worker dyno, which is what discord should need)
$ heroku ps:scale -a <YOUR_HEROKU_APP_NAME> worker=1
Then stop it with:
$ heroku ps:scale -a <YOUR_HEROKU_APP_NAME> worker=0
I've found this is much simpler than using git, especially if you're doing tests or simple/quick stuff.
Possible solutions:
Set up a Procfile. A Procfile basically tells Heroku what command to run when your app is deployed. Inside the Procfile, write worker: node index.js. Also, make sure Procfile has a capital "P".
Set up package.json.
npm init
Then just skip through the set up and your file should be automatically created. IMPORTANT. In your package.json file, add your node and npm versions.
node -v
npm -v
Then go an type this in your package.json.
"engines": {
node: "your-version-here"
npm: "your-version-here"
}
Then try deploying your app to Heroku again. Also, make sure you have the "nodejs" buildpack set up for your app. Run it and test the discord bot.

Heroku: Error 9 when using 'heroku local web' with the Node.js starter project

I'm following the "Getting Started on Heroku with Node.js" tutorial, and I got to the part where I use "heroku local web" to launch my app. When I try, I get this error message:
[OKAY] Loaded ENV .env File as KEY=VALUE Format
08:54:38 web.1
| (node:4716) [DEP0062] DeprecationWarning: node --debug and node --debug-brk are invalid. Please
use node --inspect or node --inspect-brk instead.
08:54:38 web.1
Exited with exit code 9
I had this issue with Heroku after upgrading to Node 8.8.1.
It turned out my Procfile indeed contained the deprecated --debug param:
web: node --debug=5858 index.js
I simply changed this to
web: node --inspect=5858 index.js
And now everything seems to works as expected.
You may be having this issue because like me, you based your project of the Getting Started with Node on Heroku repo, which still uses an older version of Node.
I got the same Error, Seems like the issue is with node version, downgrading Node had fixed the issue.
Follow this link to downgrade Node

Heroku gulp deploy

I read all the topic about gulp and heroku but I don't udnerstand what's wrong with my procfile.
When I'm in local launching like that works:
node node_modules/gulp/bin/gulp build
So in the procfile I write:
web: node node_modules/gulp/bin/gulp build
as advised here http://www.sitepoint.com/deploying-heroku-using-gulp-node-git/
But still this is not working. No build problem nothing with the heroku log...
Any idea ?

Running Dart App on Heroku

I am following this blog to upload a Dart app to Heroku and run it. I have gotten to the point where the app is successfully deployed to Heroku, but the app is not running. The following is from the Heroku logs:
2012-12-20T18:04:57+00:00 heroku[web.1]: Starting process with command `dart TestApp.dart`
2012-12-20T18:04:57+00:00 app[web.1]: bash: dart: command not found
2012-12-20T18:04:58+00:00 heroku[web.1]: Process exited with status 127
2012-12-20T18:04:58+00:00 heroku[web.1]: State changed from starting to crashed
The following is the contents of my Procfile
web: dart TestApp.dart
Can anyone point me towards a solution to this error?
You should have forgotten to add the buildpack to the config. See the getting started of Heroku Buildpack for Dart.
Basically, you have to use the following commands :
$> heroku create myapp_name -s cedar
$> heroku config:add BUILDPACK_URL=https://github.com/igrigorik/heroku-buildpack-dart.git
WARNING : With the last version of buildpack it seems dart command is no more in the PATH. A workaround is to use the full path in Procfile:
web: ./dart-sdk/bin/dart TestApp.dart

Resources