WebFaction
Community site: login faq

So I've managed to get Erlang, Elixir and Phoenix installed manually and have Node.js installed via the application wizard. I can make a project, do work in both the erl and iex repls, but if I try to start the phoenix web server I get the following error message:


/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:321
        throw er
        ^

Error: EACCES: permission denied, scandir '/home'
  at Error (native)
  at Object.fs.readdirSync (fs.js:945:18)
  at GlobSync._readdir (/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:275:41)
  at GlobSync._processReaddir (/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:135:22)
  at GlobSync._process (/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:130:10)
  at GlobSync._processReaddir (/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:205:10)
  at GlobSync._process (/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:130:10)
  at new GlobSync (/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:46:10)
  at Function.globSync [as sync] (/home/username/dev/test/node_modules/true-case-path/node_modules/glob/sync.js:24:1
  at trueCasePathSync (/home/username/dev/test/node_modules/true-case-path/index.js:29:15)
  at trueCasePath (/home/username/dev/test/node_modules/deppack/lib/resolve.js:12:46)
  at checkImproperCase (/home/username/dev/test/node_modules/deppack/lib/resolve.js:71:15)
  at browserResolve (/home/username/dev/test/node_modules/deppack/lib/resolve.js:91:23)
  at /home/username/dev/test/node_modules/browser-resolve/index.js:269:13
  at /home/username/dev/test/node_modules/resolve/lib/async.js:44:21
  at ondir (/home/username/dev/test/node_modules/resolve/lib/async.js:187:31)
  at /home/username/dev/test/node_modules/resolve/lib/async.js:153:39
  at onex (/home/username/dev/test/node_modules/resolve/lib/async.js:93:22)
  at /home/username/dev/test/node_modules/resolve/lib/async.js:24:18
  at FSReqWrap.oncomplete (fs.js:117:15)

This appears to be a problem with node.js, but I'm not sure exactly what it could be. Obviously it shouldn't be scanning the '/home' directory, but I don't know enough about Node to know why it would do that. Any ideas on how to fix this?

I documented my process for getting this far and have included it here in case I did something obviously wrong. Thanks in advance for the help!


Before doing anything else the following conveniences should be performed:
     mkdir ~/src

     nano .bash_profile and add ~/bin to the path as follows:

          PATH=$PATH:$HOME/bin
          export PATH

Start by installing Erlang:
    cd ~/src

    wget http://erlang.org/download/otp_src_19.0.tar.gz

    tar -xf otp_src_19.0.tar.gz 
    cd otp_src_19.0

    ./configure --prefix=$HOME

    make
    make install

Next install Elixir:
    cd ~/lib
    git clone https://github.com/elixir-lang/elixir.git
    cd elixir
    make clean test

For temporary access use the following to append to the path:

     export PATH="$PATH:$HOME/lib/elixir/bin"

Or, use the following to add a symbolic link to the ~/bin folder:

    ln -s $HOME/lib/elixir/bin/elixir $HOME/bin/elixir
    ln -s $HOME/lib/elixir/bin/elixirc $HOME/bin/elixirc
    ln -s $HOME/lib/elixir/bin/iex $HOME/bin/iex
    ln -s $HOME/lib/elixir/bin/mix $HOME/bin/mix

Next install the latest Phoenix Framework:
    cd ~/lib
    mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Add symbolic links for the Node.js commands:

     ln -s $HOME/webapps/nodejs/bin/node $HOME/bin/node
     ln -s $HOME/webapps/nodejs/bin/npm $HOME/bin/npm

And now you can make a new phoenix app with:

  mix phoenix.new [app_name]

asked 13 Jul '16, 05:01

frank_taylor
113
accept rate: 0%

edited 20 Jul '16, 15:28

This is a well-written question and includes a lot of detail.

I haven't been able to determine a solution yet, but I'll continue looking into it.

In the meantime, I have one inquiry - is there a particular reason that you're installing Elixir and Phoenix from ~/lib?

(13 Jul '16, 08:56) ryans ♦♦

No real reason. I think I ended up moving the source files into ~/src after installing everything which probably could have been avoided had I done things differently, but this method worked so I wanted to document it as-is in case anyone else was struggling.

(20 Jul '16, 15:17) frank_taylor

Despite that error, your server looks up and running and responding to requests.

It seems that your framework tries to setup some inotify watchers and since /home is inaccessible (you cannot list it) throws that error.

To fix this, you can either create your project without ecto using mix phoenix.new web --no-ecto or even better the bare minimum with mix phoenix.new web --no-brunch --no-ecto, or you can edit the config/dev.exs file and set the watchers line to:

watchers: []

That is, empty the content between the [ ] characters.

permanent link

answered 13 Jul '16, 15:39

iliasr ♦♦
2.1k14
accept rate: 35%

Hi iliasr,

The Phoenix server isn't actually running at the moment. What you're probably seeing is the Django instance I have running. I have multiple frameworks I'm testing and comparing.

That said, I tried modifying the watchers value like you suggested and that specific error went away. Unfortunately, now I'm getting a syntax error in what appears to be a generated file. I'll keep digging and see if I can figure that piece out.

Thanks for your help, Frank

(13 Jul '16, 18:13) frank_taylor

No, I've used curl http://localhost:4000 after starting your server and, despite the error and some postgresql configuration, I could see the landing page.

(13 Jul '16, 18:14) iliasr ♦♦

Here's an update for anybody else trying this:

I couldn't get the original test application working at all. It would just exit with an error. My guess was there was a typo somewhere that I was overlooking so I started from scratch. I did a bit more testing to figure out what I could get working. It seems that brunch is the problem. I can get Ecto working just fine but trying to install brunch manually gives me the following errors:

npm install -g brunch

npm WARN optional Skipping failed optional dependency /brunch/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14

So I just built an app using:

 mix phoenix.new app_name --no-brunch

And for the time being I'm manually updating my static files until I can learn a better way.

If I can figure out how to get brunch working or some alternative I'll post another response here for other users.

Thanks again @iliasr for your help.

permanent link

answered 20 Jul '16, 15:09

frank_taylor
113
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×102
×67
×2
×2

question asked: 13 Jul '16, 05:01

question was seen: 1,904 times

last updated: 20 Jul '16, 15:28

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM