Copser

Copser

Heroku deploy problem

I have a Heroku deploy problem, currently, it’s failing on installing package.json and the error is

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Phoenix app detected
remote:
remote: -----> Loading configuration and environment
remote:        Loading config...
remote:        WARNING: phoenix_static_buildpack.config wasn't found in the app
remote:        Using default config from Phoenix static buildpack
remote:        Detecting assets directory
remote:        WARNING: no package.json detected in root nor custom directory
remote:        * assuming phoenix 1.3.x and later, please check config file
remote:        Will use phoenix configuration:
remote:        * assets path assets
remote:        * mix tasks namespace phx
remote:        Will use the following versions:
remote:        * Node 6.9.2
remote:        Will export the following config vars:
remote: DATABASE_URL
remote: NODE_MODULES_CACHE
remote: POOL_SIZE
remote: SECRET_KEY_BASE
remote:        * MIX_ENV=prod
remote: -----> Installing binaries
remote: Resolving node version 6.9.2...
remote: Downloading and installing node 6.9.2...
remote:        Installing Node 6.9.2...
remote:        Using default npm version
remote:
remote: -----> Building dependencies
remote:        Installing and caching node modules
remote: npm WARN package.json @ No description
remote: npm WARN package.json @ No README data
remote:        npm ERR! addLocal Could not install /tmp/build_86e0734371e98eb49ec08fbf671e37ba/deps/phoenix
remote:        npm ERR! addLocal Could not install /tmp/build_86e0734371e98eb49ec08fbf671e37ba/deps/phoenix_html
remote:        npm ERR! Linux 4.4.0-1057-aws
remote:        npm ERR! argv "/tmp/build_86e0734371e98eb49ec08fbf671e37ba/.heroku/node/bin/node" "/tmp/build_86e0734371e98eb49ec08fbf671e37ba/.heroku/node/bin/npm" "install" "--quiet" "--unsafe-perm" "--userconfig" "/tmp/build_86e0734371e98eb49ec08fbf671e37ba/npmrc"
remote:        npm ERR! node v6.9.2
remote:        npm ERR! npm  v3.10.9
remote:        npm ERR! path /tmp/build_86e0734371e98eb49ec08fbf671e37ba/deps/phoenix
remote:        npm ERR! code ENOENT
remote:        npm ERR! errno -2
remote:        npm ERR! syscall open
remote:
remote:        npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_86e0734371e98eb49ec08fbf671e37ba/deps/phoenix'
remote:        npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_86e0734371e98eb49ec08fbf671e37ba/deps/phoenix'
remote:        npm ERR! enoent This is most likely not a problem with npm itself
remote:        npm ERR! enoent and is related to npm not being able to find a file.
remote:        npm ERR! enoent
remote:
remote:        npm ERR! Please include the following file with any support request:
remote:        npm ERR!     /tmp/build_86e0734371e98eb49ec08fbf671e37ba/assets/npm-debug.log
remote:  !     Push rejected, failed to compile Phoenix app.

I have tried https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache, also I have elixir-buildpack.config

elixir_version=1.8.2
erlang_version=21.2.5
assets_path=assets
phoenix_ex=phx

and phoenix_static_buildpack.config

clean_cache=true
compile="compile"
config_vars_to_export=(DATABASE_URL)
node_version=6.9.5
npm=3.10.8
phoenix_relative_path=.
remove_node=false

package.json is the default one

{
  "repository": {},
  "license": "MIT",
  "scripts": {
    "deploy": "webpack --mode production",
    "watch": "webpack --mode development --watch"
  },
  "dependencies": {
    "phoenix": "file:../deps/phoenix",
    "phoenix_html": "file:../deps/phoenix_html"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "@babel/preset-env": "^7.0.0",
    "babel-loader": "^8.0.0",
    "copy-webpack-plugin": "^4.5.0",
    "css-loader": "^2.1.1",
    "mini-css-extract-plugin": "^0.4.0",
    "optimize-css-assets-webpack-plugin": "^4.0.0",
    "uglifyjs-webpack-plugin": "^1.2.4",
    "webpack": "4.4.0",
    "webpack-cli": "^2.0.10"
  }
}

but still no joy in solving the error above, did someone had something similar, how did you solved it? Thanks

Marked As Solved

Copser

Copser

OMG, I didn’t set the elixir build pack so I was not building it properly, thanks @tenzil I need to go and chill a bit :smile:

After I did heroku create --buildpack hashnuke/elixir I forgot to heroku buildpacks:set hashnuke/elixir, and that was it, people read the documentation :blush:

Also Liked

tenzil

tenzil

Hey found a similar thread in elixirforum, please check and try this

And this one as well
https://github.com/gigalixir/gigalixir-getting-started/issues/8#issuecomment-529055892

outlog

outlog

you can easily use yarn, or parcel - or whatever is the latest and greatest..

I use yarn on heroku - I just have a yarn deploy in my compile file - which of course calls the deploy script in package.json..

  "scripts": {
    "deploy": "NODE_ENV=production webpack --mode production",
Copser

Copser

@outlog, thanks for suggestion, for now it’s working fine

Where Next?

Popular in Questions Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New

Other popular topics Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement