Deployment is failing from today that is 01-jan-2015 suddenly to heroku
+ git push git#ec2-54-187-2-82.us-west-2.compute.amazonaws.com:sky-tickets-dev/skytickets-front.git stage
Everything up-to-date
+ git push -f git#heroku.com:skytickets-stage.git stage:master
Fetching repository, done.
-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js
Node engine: 0.10.21
Npm engine: 1.2.x
Start mechanism: Procfile
node_modules source: prebuilt
node_modules cached: true
NPM_CONFIG_PRODUCTION=true
NODE_MODULES_CACHE=true
PRO TIP: Avoid checking node_modules into source control
See https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
-----> Installing binaries
Downloading and installing node 0.10.21...
Resolving npm version 1.2.x via semver.io...
Downloading and installing npm 1.2.8000 (replacing version 1.3.11)...
-----> Building dependencies
Rebuilding any native modules for this architecture
-----> Checking startup method
Found Procfile
-----> Finalizing build
Creating runtime environment
Exporting binary paths
Cleaning up build artifacts
Caching node_modules for future builds
Build successful!
skytickets#0.0.1 /tmp/build_604cc19d81766dfe5375fc2195373f74
├── UNMET DEPENDENCY async#0.2.x
├── UNMET DEPENDENCY basic-logger#0.4.x
├── UNMET DEPENDENCY cloudinary#1.0.x
├── UNMET DEPENDENCY express#3.4.x
I encountered the same issue today. We had some node modules checked in to Git and some that were installed using npm install during the push, and the problem was that heroku-buildpack-nodejs was recently updated to no longer support this. Now you need to commit to either having all of the modules checked in to Git or having none checked in - the latter being the preferable way.
Their README includes a way to hotfix this issue by using a previous version of heroku-buildpack-nodejs:
For most Node.js apps this buildpack should work just fine. If, however, you're unable to deploy using this new version of the buildpack, you can get your app working again by locking it to the previous version:
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v63 -a my-app
git commit -am "empty" --allow-empty
git push heroku master
Then please open a support ticket at help.heroku.com so we can diagnose and get your app running on the default buildpack.
If you're using heroku-buildpack-multi as your buildpack (like me), you can instead add the "#v63" suffix to the buildpack URL in the .buildpacks file.
Related
I am trying to create a brand new strapi v4 project and that works fine locally but when I try and deploy it to Render or Heroku (which I’ve done before many times on Strapi v3) I get a build error when it tries to grab fontawesome-free-5.15.4.tgz from fontawesome. The error log I get on both Render and Heroku is:
error An unexpected error occurred: "https://npm.fontawesome.com/#fortawesome/fontawesome-free/-/5.15.4/fontawesome-free-5.15.4.tgz: Request failed \"401 Unauthorized\"".
info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_2d005b2a/yarn-error.log".
Is there something I can do to solve the issue? If I go to https://npm.fontawesome.com/#fortawesome/fontawesome-free/-/5.15.4/fontawesome-free-5.15.4.tgz myself, it asks for a username and password so I’m assuming that when Render/Heroku try and hit that URL they don’t have a username and password to send. (And the same goes for all the different npm.fontawesome.com links in the yarn.lock file).
If this is the case, why does the project build and run fine locally? Shouldn’t I also have to input those credentials? Do they need to be added as environment variables on Render/Heroku somehow?
Sorry, I’m quite new to all this! I was following this tutorial on the Strapi blog: https://strapi.io/blog/deploying-a-strapi-api-on-heroku
Any help is greatly appreciated.
Thanks!
P.S. Here is the full error log from Heroku:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
USE_YARN_CACHE=true
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): >=12.x.x <=16.x.x
engines.npm (package.json): >=6.0.0
engines.yarn (package.json): unspecified (use default)
Resolving node version >=12.x.x <=16.x.x...
Downloading and installing node 16.14.1...
Bootstrapping npm >=6.0.0 (replacing 8.5.0)...
npm >=6.0.0 installed
Resolving yarn version 1.22.x...
Downloading and installing yarn (1.22.17)
Installed yarn 1.22.17
-----> Installing dependencies
Installing node modules (yarn.lock)
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://npm.fontawesome.com/#fortawesome/fontawesome-free/-/5.15.4/fontawesome-free-5.15.4.tgz: Request failed \"401 Unauthorized\"".
info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_2d005b2a/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push 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.
I am using a private package from GitHub. When attempting to deploy, Heroku ignores my .npmrc file configs.
Locally, my environment file looks like:
NPM_CONFIG_GITHUB_TOKEN=[token]
Then, my .npmrc file looks like this:
[username]:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN
With this configuration, I'm able to run this locally just fine. In Heroku, I get the following error:
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_GITHUB_TOKEN=[token]
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): 12.13.x
engines.npm (package.json): unspecified (use default)
Resolving node version 12.13.x...
Downloading and installing node 12.13.1
Using default npm version: 6.12.1
-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build
-----> Installing dependencies
Installing node modules
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/download/[package]
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.P5iPk/_logs/2020-08-03T18_44_16_744Z-debug.log
-----> Build failed
The full logs say the same thing. However, if I change .npmrc to:
[username]:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
... It work just fine in Heroku, but breaks locally.
Can anyone offer some guidance on what I'm doing wrong here? I've researched this for hours with no success. While the obvious solution is a different local version, this is an opensource project and I want to be able to provide straightforward installation directions.
When I deploy to Heroku I usually set the environment variables in my app settings on Heroku and I've never had a problem, you could try that
I forked node-js-sample and made just added index.htm with some content
When I click the button "Doploy to heroku" app fails to build with following error:
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): 4.0.0
engines.npm (package.json): unspecified (use default)
Resolving node version 4.0.0...
Downloading and installing node 4.0.0...
Detected package-lock.json: defaulting npm to version 5.x.x
Bootstrapping npm 5.x.x (replacing 2.14.2)...
npm 5.x.x installed
ERROR: npm is known not to run on Node.js v4.0.0
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 4.7.0 to use this
version of npm. You can find the latest release of Node.js at
https://nodejs.org/
ERROR: npm is known not to run on Node.js v4.0.0
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 4.7.0 to use this
version of npm. You can find the latest release of Node.js at
https://nodejs.org/
ERROR: npm is known not to run on Node.js v4.0.0
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 4.7.0 to use this
version of npm. You can find the latest release of Node.js at
https://nodejs.org/
-----> Change to Node.js build process
Heroku has begun executing the "build" script defined in package.json
during Node.js builds.
Read more: https://devcenter.heroku.com/changelog-items/1573
-----> 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
From what I understand heroku try to runs my code with incorrect version of node.js, but why?
The repository hasn't been updated in 4 or more years and still depend on node.js 4 and lists the same on the package.json. It is a compatibility issue, before deploying change it to 6.0.0 and try, you might have luck.
Ran into the same issue recently which was a real pain, found a solution here https://devcenter.heroku.com/articles/nodejs-support
Currently, supported versions are 10.x, 12.x, 13.x, and 14.x.
You should always specify a Node.js version that matches the runtime
you’re developing and testing with.
Updated node globally and specified the engine in package.json like:
"engines": {
"node": "10.20.x"
},
Hope this helps someone
I am having trouble running custom node version on node0.10 cartridge on open shift which you can find here.
I get to install the new node version just great, however open shift keeps using the old node 10.25.
Deoploy log:
remote: Activating deployment
remote: - Checking to see if Node.js version 0.10.33 is installed ...
remote: - Node.js version 0.10.33 is already installed
remote:
remote: - pre_start_nodejs: Adding Node.js version 0.10.33 binaries to path
remote: -this is the path: /var/lib/openshift/54b6ea6e4382ece151000039/app-root/data/node-v0.10.33-linux-x64/bin:/var/lib/openshift/54b6ea6e4382ece151000039/app-root/runtime/repo/node_modules/.bin:/var/lib/openshift/54b6ea6e4382ece151000039//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/bin:/usr/bin:/usr/sbin
remote: - PATH set to include custom node version (0.10.33) from
remote: /var/lib/openshift/54b6ea6e4382ece151000039/app-root/data/node-v0.10.33-linux-x64/bin
remote: PATH = /var/lib/openshift/54b6ea6e4382ece151000039/app-root/data/node-v0.10.33-linux-x64/bin:/var/lib/openshift/54b6ea6e4382ece151000039/app-root/runtime/repo/node_modules/.bin:/var/lib/openshift/54b6ea6e4382ece151000039//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/bin:/usr/bin:/usr/sbin
remote: Starting NodeJS cartridge
Everything looks great and awesome, until I run the app which says: 10.25...
rhc tail:
v0.10.25
/opt/rh/nodejs010/root/usr/bin:/opt/rh/v8314/root/usr/bin:/var/lib/openshift/54b6feb9e0b8cd56c00000e1/app-root/data/node-v0.10.33-linux-x64/bin:/var/lib/openshift/54b6feb9e0b8cd56c00000e1/app-root/runtime/repo/node_modules/.bin:/var/lib/openshift/54b6feb9e0b8cd56c00000e1//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/bin:/usr/bin:/usr/sbin
undefined
Even when i rhc ssh to my app and try node -v i get 10.33...
on start time the PATH env gets overwritten and causes node to use the old bins...
PS: I am trying to deploy a Meteor app (1.0.2.1)
Nevermind, figured it out :-)
If you want to use custom node #openshift take a look at this repo.
Hope I get to help someone!