Error in mix phx.new: (File.Error) could not make directory (with -p)

Hi,
I’ve just upgraded to latest version of Elixir and upgrade the phx.new mix task as well (mix archive install hex pox_new). On a Mac

Then I launch:
mix phx.new kelaportal --adapter bandit --database sqlite3 --no-mailer

after a lot of file creations, I have the following error message:

  • extracting kelaportal/assets/vendor/heroicons/optimized
    ** (File.Error) could not make directory (with -p) “/Users/dompdv/kelaportal/assets/vendor/heroicons/optimized”: file already exists
    (elixir 1.17.3) lib/file.ex:346: File.mkdir_p!/1
    lib/phx_new/generator.ex:87: anonymous fn/2 in Phx.New.Generator.copy_from/3
    (elixir 1.17.3) lib/enum.ex:1703: Enum.“-map/2-lists^map/1-1-”/2
    (elixir 1.17.3) lib/enum.ex:1703: Enum.“-map/2-lists^map/1-1-”/2
    lib/phx_new/generator.ex:85: anonymous fn/7 in Phx.New.Generator.copy_from/3
    (elixir 1.17.3) lib/enum.ex:2531: Enum.“-reduce/3-lists^foldl/2-0-”/3
    lib/phx_new/generator.ex:67: Phx.New.Generator.copy_from/3
    lib/phx_new/single.ex:146: Phx.New.Single.generate/1

elixir --version and mix --version : both 1.17.3

Any idea ? What do I do wrong here ?

That’s very odd, the latest phx.new does not create that folder anymore.
It now uses a hex package for the heroicons where they are stored within the deps folder.

1 Like

Sorry everybody.
I used the good old way: uninstall everything and reinstall from a clean state.
It works