Creating a new phoenix project on Windows fails on extracting pento/assets/vendor/heroicons/optimized

When creating a new phoenix project on Windows 10, with mix phx.new pento, the installation fails on the extraction of vendor/heroicons/optimized with error message: file already exists

It’s a brand new setup with versions:
Erlang/OTP 27 [erts-15.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Elixir 1.17.3 (compiled with Erlang/OTP 27)

* creating pento/assets/vendor/topbar.js
* creating pento/assets/css/app.css
* creating pento/assets/tailwind.config.js
* creating pento/assets/vendor/heroicons/LICENSE.md
* creating pento/assets/vendor/heroicons/UPGRADE.md
* extracting pento/assets/vendor/heroicons/optimized
** (File.Error) could not make directory (with -p) "c:/Users/olivier.boudry/Downloads/pento/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:141: Phx.New.Single.generate/1

I’ve not found similar error messages when searching the forum and issues for help. I thought it may be due to a bad mkdir command in the path, but even when running it in git bash shell, and therefore different mkdir command, I’m getting the same issue.

Any idea what could go wrong ?

Do you get the same error if you run the phx.new command in a different directory?

Also, have you run the install for phx.new recently?

mix archive.install hex phx_new

1 Like

Running mix archive.install hex phx_new fixed it. I did not realize I still had an old version installed.

Thanks!