Installing Phoenix error

Hi,
I tried to install Phoenix,

C:\Dev\elixir\new_phoenix_framework\apps>mix phoenix.new rsvp_web --no-ecto
* creating rsvp_web/config/config.exs
* creating rsvp_web/config/dev.exs
* creating rsvp_web/config/prod.exs
* creating rsvp_web/config/prod.secret.exs
* creating rsvp_web/config/test.exs
* creating rsvp_web/lib/rsvp_web.ex
* creating rsvp_web/lib/rsvp_web/endpoint.ex
* creating rsvp_web/test/views/error_view_test.exs
* creating rsvp_web/test/support/conn_case.ex
* creating rsvp_web/test/support/channel_case.ex
* creating rsvp_web/test/test_helper.exs
* creating rsvp_web/web/channels/user_socket.ex
* creating rsvp_web/web/router.ex
* creating rsvp_web/web/views/error_view.ex
* creating rsvp_web/web/web.ex
* creating rsvp_web/mix.exs
* creating rsvp_web/README.md
* creating rsvp_web/web/gettext.ex
* creating rsvp_web/priv/gettext/errors.pot
* creating rsvp_web/priv/gettext/en/LC_MESSAGES/errors.po
* creating rsvp_web/web/views/error_helpers.ex
* creating rsvp_web/.gitignore
* creating rsvp_web/brunch-config.js
* creating rsvp_web/package.json
* creating rsvp_web/web/static/css/app.css
* creating rsvp_web/web/static/css/phoenix.css
* creating rsvp_web/web/static/js/app.js
* creating rsvp_web/web/static/js/socket.js
* creating rsvp_web/web/static/assets/robots.txt
* creating rsvp_web/web/static/assets/images/phoenix.png
* creating rsvp_web/web/static/assets/favicon.ico
* creating rsvp_web/test/controllers/page_controller_test.exs
* creating rsvp_web/test/views/layout_view_test.exs
* creating rsvp_web/test/views/page_view_test.exs
* creating rsvp_web/web/controllers/page_controller.ex
* creating rsvp_web/web/templates/layout/app.html.eex
* creating rsvp_web/web/templates/page/index.html.eex
* creating rsvp_web/web/views/layout_view.ex
* creating rsvp_web/web/views/page_view.ex

Fetch and install dependencies? [Yn] Y
* running mix deps.get
* running npm install && node node_modules/brunch/bin/brunch build

We are all set! Run your Phoenix application:

    $ cd rsvp_web
    $ mix phoenix.server

You can also run your app inside IEx (Interactive Elixir) as:

    $ iex -S mix phoenix.server

* error command failed to execute, please run the following command again after installation: "npm install && node node_modules/brunch/bin/brunch build"

C:\Dev\elixir\new_phoenix_framework\apps>cd rsvp_web

C:\Dev\elixir\new_phoenix_framework\apps\rsvp_web>mix phoenix.server

Compiling 11 files (.ex)
Generated rsvp_web app
[info] Running RsvpWeb.Endpoint with Cowboy using http://localhost:4000
[error] Could not start node watcher because script "c:/Dev/elixir/new_phoenix_framework/apps/rsvp_web/node_modules/brunch/bi
n/brunch" does not exist. Your Phoenix application is still running, however assets won't be compiled. You may fix this by ru
nning "npm install".
Terminate batch job (Y/N)?
^C

C:\Dev\elixir\new_phoenix_framework\apps\rsvp_web>npm install && node node_modules/brunch/bin/brunch build

npm WARN deprecated babel-preset-es2015@6.24.1: ďż˝  Thanks for using Babel: we recommend using babel-preset-env now: please re
ad babeljs.io/env to update!
npm WARN deprecated babel-preset-es2016@6.24.1: ďż˝  Thanks for using Babel: we recommend using babel-preset-env now: please re
ad babeljs.io/env to update!
npm ERR! Unexpected end of input at 1:20137
npm ERR! asShrinkwrap":false},"6.12.0":{"name":"babel-traverse","version":"6.1
npm ERR!                                                                      ^

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SAINT\AppData\Roaming\npm-cache\_logs\2017-10-07T22_07_23_720Z-debug.log

npm -v : 5.3.0
node -v : 8.5.0
elixir -v : 1.5.0

Please help. i already tried the solution on google, but still no luck.

You are using an older phoenix version with the latest elixir version. It might not be working… Either try the latest phoenix, or try asdf to manage multiple elixir/erlang version

1 Like

How can i install the latest Version sir?
Ialready tried this command

mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

That is the old version. If You have the latest, try

mix phx.new rsvp_web --no-ecto

or better…

mix phx.new rsvp --no-ecto

1 Like

Note You should be aware of the Phoenix changelog. As they are some changes in the application structure. Mainly the context thing…

1 Like

Sir it still gives me the same error warning.
The console says i need to run this command.

npm install && node node_modules/brunch/bin/brunch build

and still it gives me the same error warning at the end…

npm ERR! Unexpected end of input at 1:20137
npm ERR! asShrinkwrap":false},"6.12.0":{"name":"babel-traverse","version":"6.1
npm ERR!

As a quick fix You can run mix with --no-brunch option.

Your error is clearly because of not being able to run brunch. I am using the exact same version of node and npm, but on MacOsx so I cannot tell You about Windows.

Example:

mix phx.new rsvp --no-ecto --no-brunch
cd rsvp
mix phx.server

This should be working…

Next You will have to investigate why your brunch is not working. I cannot help You for this, as I use webpack instead and do not use brunch.

And FYI, brunch is just a javascript bundler.

1 Like

yes sir, i thnk brunch is the problem… thank you so much for the help sir. :slight_smile: