(Mix) The task "phx.gen.live" could not be found ... when creating new project

I already have a phoenix liveview project in another folder. Just upgraded to LiveView .20. I wanted to create a new skeleton project in another folder to see how to integrate into my legacy app.

First issue:
mix phx.new sketch_links
gave error:
(Mix) The task "phx.new" could not be found Note no mix.exs was found in the current directory

Ran the following based on another forum post:

mix archive.install hex phx_new

After that, I got phx.new to run and I created a project. Then I tried to do:
mix phx.gen.live Authors Author authors name:string

Got error:
** (Mix) The task "phx.gen.live" could not be found Note no mix.exs was found in the current directory

Tried this but didn’t work.
mix archive.install hex phx_gen_live

Then I tried:
mix archive.install
Error:
** (Mix) Cannot create archive without input directory, please pass -i as an option

I don’t understand what it means by “input directory.” I looked at docs but still don’t understand what it’s asking for.

Tried:
mix do archive.build, archive.install
Got:
** (Mix) Cannot create archive without input directory, please pass -i as an option

How can I get Mix to work so that I can just set up this new LiveView .20 project to see what has changed? I want to see the new phx.gen.auth.

That’s weird, if phx.new created a project then that project should have a mix.exs file. Are you sure you were in the project directory, does it have a mix.exs file?

2 Likes

Head hitting desk over and over. :woman_facepalming:

I created the project and forgot to cd into that project directory before running phx.gen.live. You were right. I was in the wrong directory. thank you!!!