Heroku rejecting push of a Meteor app - node.js

I keep getting this error when I try to push my app to Heroku:
git push heroku master
Counting objects: 14, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (14/14), 3.18 KiB | 0 bytes/s, done.
Total 14 (delta 11), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: -----> Meteor version: Meteor 1.4.0.1
remote: -----> Checking if this meteor version supports --server-only
remote: cp: cannot stat ‘/app/tmp/cache/1.3.4.1/.meteor/packages/meteortool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node\n/app/tmp/cache/1.3.4.1/.meteor/packages/meteor-tool/.1.4.0-1.1lf30np++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node’: No such file or directory
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to [name-of-app].
What could the problem be? Just a few hours ago I managed to push with no errors.

Running this worked for me:
heroku config:set BUILDPACK_CLEAR_CACHE=1
It forced heroku to download meteor again and overwrite the version 1.4 that was updated automatically. If you are using the horse buildback check how the issue evolves: https://github.com/AdmitHub/meteor-buildpack-horse/issues/132

You need to clear the cache from the previous built, For that you have to install Heroku Repo plugin
heroku plugins:install heroku-repo
and clear your app cache by running repo:purge_cache.
if you have multiple apps don't forget to specify your appname
heroku repo:purge_cache
and then you could push your code
git push heroku master

The problem was actually a meteor version mismatch. I had to upgrade to meteor 1.4 which presented an issue of its own. If you have problems updating to 1.4, you could check out this thread

Related

Heroku Node.js npm install failing suddenly

I have never touched my package.json file for as long as my bot has been deployed and I've never had issues deploying my bot on Heroku...until today. Seemingly inexplicably, I'm suddenly getting the following error today when I try to deploy my bot — after having changed nothing about my package.json file and doing nothing to my Heroku cache.
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 17.0.1
engines.npm (package.json): 8.49.2
Resolving node version 17.0.1...
Downloading and installing node 17.0.1...
Bootstrapping npm 8.49.2 (replacing 8.1.0)...
Unable to install npm 8.49.2; does it exist?
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
On a hunch, based on the Stack Overflow article found here, I ran the heroku config:set NODE_MODULES_CACHE=false command for my app, to no avail. I'm still encountering this issue and there appears to be no sign of any successful deployments any time soon.
Any assistance with this would be greatly appreciated.
Typos strike once again. I simply had an invalid version number specified when trying to explicitly call out a version of npm rather than *, fat-fingering a 4 instead of a 1. Thanks go to Chris from the comment above.

i got this error when i tried to git push | [ErrorException] : composer failed

I have been following this tutorial (Tutorial: Build a PHP and MySQL app in Azure App Service) https://learn.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app?pivots=platform-linux#deploy-to-azure
the problem is when i try to git push git push azure master
i get this error.
remote: Loading composer repositories with package information
remote: Installing dependencies (including require-dev) from lock file
remote:
remote:
remote: An error has occurred during web site deployment.
remote: [ErrorException]
remote: composer failed
remote: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
remote:
remote:
remote: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
remote:
remote: Deployment Logs : 'https://larave-tasks.scm.azurewebsites.net/newui/jsonviewer?view_url=/api/deployments/dae345ee76d1755cfccd62004c6fc0c472fed981/log'
To https://larave-tasks.scm.azurewebsites.net/larave-tasks.git
* [new branch] master -> master
Can someone help me solve this error ...
The laravel-tasks project is four years old. That project requires Laravel 5.4 and PHP 5.6. Both are old. The current mainstream PHP version is 7.4. Laravel is version 8.
The azure command is specifying PHP 7.2 which is not supported by the project.
You will need to download the project to your local system, patch and update, and then deploy with the patched version. The error that you have is caused by incompatibilities with composer. You will need to run composer update which will fail.
Unless you are experienced with Laravel and PHP pick a different project to learn from.

Node.js application not detected by Heroku

I created a small site in Visual Studio and used Node.js and Express. I can access it via Visual Studio and with Heroku local web. However, when trying to push it to Heroku, I get the error: Application not supported by 'heroku/nodejs' buildpack
I read through the documentation provided by Heroku, but didn't find any solution.
ERROR: Application not supported by 'heroku/nodejs' buildpack
remote: !
remote: ! The 'heroku/nodejs' buildpack is set on this application, but was
remote: ! unable to detect a Node.js codebase.
remote: !
remote: ! A Node.js app on Heroku requires a 'package.json' at the root of
remote: ! the directory structure.
remote: !
remote: ! If you are trying to deploy a Node.js application, ensure that this
remote: ! file is present at the top level directory. This directory has the
remote: ! following files:
remote: !
remote: ! Portfolio/
remote: ! Portfolio.sln
remote: !
remote: ! If you are trying to deploy an application written in another
remote: ! language, you need to change the list of buildpacks set on your
remote: ! Heroku app using the 'heroku buildpacks' command.
remote: !
remote: ! For more information, refer to the following documentation:
remote: ! https://devcenter.heroku.com/articles/buildpacks
remote: ! https://devcenter.heroku.com/articles/nodejs-support#activation
This error output is pretty straightforward - make sure your package.json is in the top level directory for your project and try deploying again. Based on your comment, it seems that package.json is located at {project_root}/Portfolio/package.json instead of {project_root}/package.json.
Look at this error message.
A Node.js app on Heroku requires a 'package.json' at the root of the directory structure.
Do your package.json is on root directory ?

wkhtmltopdf doesn't work when deployed in heroku python app using(Flask) pdfkit and wkhtmltopdf

I am in a process of converting HTML files to pdf in python and attach these pdf files to mail and process it
I've installed pdfkit(0.6.1), wkhtmltopdf(0.2) and also wkhtmltopdf for windows. And added wkhtmltopdf bin path. It is working in my local system without any issue here is my code
url=""
PDF = pdfkit.from_url(url, False)
result= SendPDFtomail(PDF)
return result
When I tried to push the same code into heroku by adding the buildpack for wkhtmltopdf and buildpacks for my application are
1. heroku/python
2. https://github.com/dscout/wkhtmltopdf-buildpack.git
When i push my build to heroku
git push heroku master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 336 bytes | 84.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3.6 is python-3.6.6 (you
are using python-3.6.4, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version
(python-3.6.6).
remote: Learn More:
https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote:
remote: -----> wkhtmltopdf app detected
remote: -----> Moving wkhtmltopdf binaries to /app/bin
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 103.8M
remote: -----> Launching...
remote: Released v19
remote: https://XXXXXXX.herokuapp.com/ deployed to
Heroku
remote:
remote: Verifying deploy... done.
my app was deployed without any issues and when am running the code in Heroku I am getting the error
Exception :No wkhtmltopdf executable found: "b''"
If this file exists please check that this process can read it.
Otherwise please install wkhtmltopdf -
https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf
which is the same error I received when I didn't add the wkhtmltopdf path to the system, As we can see in my build Moving wkhtmltopdf binaries to /app/bin, how can I make my Heroku configure to this wkhtmltopdf binary path? how can we use config vars in Heroku to make this work
I've tried this generating-pdfs-wkhtmltopdf-heroku but couldn't get it. And wherever I search am getting solutions for ruby that we need to configure the gem file, how can I do it in python
I've been working on it from past two days, Please help me out
Thanks in advance
Meghana Goud
I am now using OSX and heroku to deploy my flask app.
When deployed the heroku wkhtmltopdf binary is in ./bin/wkhtmltopdf.
So I wrote this code to deal with this.
if (platform.system() == 'Darwin'):
config = pdfkit.configuration()
else:
config = pdfkit.configuration(wkhtmltopdf='./bin/wkhtmltopdf')

Heroku NodeJS Help – Push rejected, no Cedar-supported app detected

Need help on deploying a nodeJS app to Heroku please. I have my Procfile and Package.son file. This is what I am getting...
remote: Building source: remote:
remote: -----> Fetching custom git
buildpack... done
remote:
remote: ! Push rejected, no Cedar-supported app detected
remote: HINT: This occurs when Heroku cannot detect the build pack
remote: to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
The message doesn't make sense to me as it says fetching build pack done..what else am I missing? Any suggestions please?
Thanks.
It sounds like you've set a custom buildpack. It's usually best, with node, to just use the official buildpack:
heroku buildpack:unset
Once you set that and push, it won't say "fetching custom buildpack," but rather it will tell you that it detected a node.js app. If it doesn't detect a node.js app, that means that your app is missing its package.json file (lowercase).
I was having the same problem. I fixed it by first removing the custom buildpack I had set using the command:
heroku buildpacks:remove my-buildpack
To see what buildpack you are using you can run the command heroku buildpacks.
I then ran the command npm init to create a package.json file, and committed the changes.
Then to use the official buildpack I ran the command:
heroku buildpacks:set heroku/nodejs
And I was good to go! The error went away. If you already have a package.json you may not need to worry about running npm init, but it worked for me. Heroku talks about this problem in depth here: https://devcenter.heroku.com/articles/troubleshooting-node-deploys

Resources