Missing files after creating a Phoenix project?

Hello,

I am trying to create a phoenix project and it does well except that it doesn’t install everything.
I do not have the “channel” folder in lib, neither the “node_modules”, “static”, and json files and webpack.confing.js in the assets. How can I install them?

Thanks in advance :blush:

you’re probably using the most recent Phoenix, and following some sort of slightly outdated tutorial. There are things that chagned in Phoenix along the way, and more will change in 1.7 as well.

2 Likes

I was in the same boat of confusion about “live” folders when I first started learning. Didn’t realise for a while that “live” is a specific part of Phoenix and that you need to manually generate.

https://hexdocs.pm/phoenix/Mix.Tasks.Phx.Gen.Channel.html

Channels aren’t automatically created when you make a new project because not every project needs channels and channels are named based on the users preference.

You mentioned JSON too so you may want this:
https://hexdocs.pm/phoenix/Mix.Tasks.Phx.Gen.Json.html

Tutorials for Elixir/Phoenix can be kind of confusing due to most of them being 2+ years out of date.

1 Like