heroku-buildpack-phoenix-static
heroku-buildpack-phoenix-static copied to clipboard
New versions of node break the build
When I tried building with node js 1.14+ i got this error:
/tmp/codon/tmp/buildpacks/046a7dbb0bd21772e3b9d262d0fbe72be102671d/lib/build.sh: line 29: fail_bin_install: command not found
And the whole deployment would fail. However, when I used version 10.20.1 (because that's the version used in the phoenix docs) it just suddenly did work. I did not test for any versions in between that one and 1.14.0
I also had a problem with a newer Node version (12.15.0):
...
-----> Phoenix app detected
-----> Loading configuration and environment
Loading config...
Detecting assets directory
WARNING: no package.json detected in root nor custom directory
* assuming phoenix 1.3.x and later, please check config file
Will use phoenix configuration:
* assets path assets
* mix tasks namespace phx
Will use the following versions:
* Node 12.15.0
Will export the following config vars:
DATABASE_URL
POOL_SIZE
SECRET_KEY_BASE
* MIX_ENV=prod
-----> Installing binaries
Resolving node version 12.15.0...
Downloading and installing node 12.15.0...
Installing Node 12.15.0...
Using default npm version 6.13.4
-----> Building dependencies
Installing node modules
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! invalid bin entry for package @babel/[email protected]. key=parser, value=bin/babel-parser.js
npm ERR! A complete log of this run can be found in:
npm ERR! /app/.npm/_logs/2021-02-21T01_45_52_394Z-debug.log
! Push rejected, failed to compile Phoenix app.
! Push failed
Fixed and successfully deployed using Node 10.20.1
Same problem here with a deployment using Heroku.
npm 6.14.13
and yarn 1.22.11
-----> Installing binaries
remote: Resolving node version 6.14.13...
remote: /tmp/codon/tmp/buildpacks/e1ebc0ce039e2d6d22ca731aebc3580cbde46136/lib/build.sh: line 28: fail_bin_install: command not found
remote: ! Push rejected, failed to compile Phoenix app.
Edit : The version of node was wrong. The error was solved by adding this to phoenix_static_buildpack.config
:
node_version=14.17.3
npm_version=6.14.13
yarn_version=1.22.11