2

I am having trouble installing appium on Ubuntu. I tried the normal apt-get install way and found out that I should not be doing that. So I uninstall node, and appium from apt-get and I tried a variation on the instructions listed in these threads

How to setup Appium in Ubuntu for android

How to install and run appium in linux?

I did the following

  1. Install rvm

    \curl -sSL https://get.rvm.io | bash -s stable --ruby

  2. Install ruby with rvm

    rvm install 2.2.3

  3. Make my shell a login shell in the options of the terminal emulator (I'm using Terminator, not the regular Terminal) rvm said to do this instead of rvm --default use 2.2.3 when I tried to run rvm --default. The installation of ruby that was put on by installing rvm was 2.2.1 so at this point I'm using 2.2.1 of Ruby.

  4. Install dependent packages from the other question thread. I just did this because the other thread did this.

    sudo apt-get install build-essential curl m4 texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev

  5. Install Linux homebrew from here https://github.com/Homebrew/linuxbrew

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"

  6. Get Linux homebrew up and running

    brew doctor

    brew install git (I had to do this because brew doctor said my git was too old)

  7. Installing the dependent packages for node. I had to do this because when I tried to run brew install node it failed with a compilation error about a missing header file. When I googled for that filename, someone mentioned that that's the package needed for that file

    sudo apt-get install libx11-dev

  8. Install gcc with brew. I had to do this because I got further compilation errors after trying brew install node after installing the package. I looked up the bugs for node on the homebrew github https://github.com/Homebrew/linuxbrew/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+node and this bug https://github.com/Homebrew/linuxbrew/issues/597 said to install node with gcc 5. When I tried that command, it said my gcc was too old (It was 4.6) and to install gcc5 with brew.

    brew install gcc

  9. Install node

    brew install node --cc=gcc-5

  10. At this point brew and node are installed. Then I tried to do an install of appium. Both global and non-global and they both failed, with this giant set of compilation errors. (I'm not sure how to make the stackoverflow thing just put the code as raw text). Of course at this point, I'm at my wits end and I don't know how to make node compile appium properly. I'm not sure how to read these compilation errors and track down their real root cause. I will file a bug on node and appium and paste it back here. Any assistance would be appreciated.

    username@redacted:~$ npm install -g appium
    npm WARN optional dep failed, continuing udidetect@1.0.7
    npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
    
    > bufferutil@1.1.0 install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil
    > node-gyp rebuild
    
    make: Entering directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil/build'
      CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
    In file included from ../src/bufferutil.cc:16:0:
    ../node_modules/nan/nan.h:261:25: error: redefinition of 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)'
     NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                             ^
    ../node_modules/nan/nan.h:256:25: note: 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)' previously declared here
     NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                             ^
    ../node_modules/nan/nan.h:661:13: error: 'node::smalloc' has not been declared
         , node::smalloc::FreeCallback callback
                 ^
    ../node_modules/nan/nan.h:661:35: error: expected ',' or '...' before 'callback'
         , node::smalloc::FreeCallback callback
                                       ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)':
    ../node_modules/nan/nan.h:665:50: error: 'callback' was not declared in this scope
             v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                      ^
    ../node_modules/nan/nan.h:665:60: error: 'hint' was not declared in this scope
             v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                                ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)':
    ../node_modules/nan/nan.h:672:67: error: no matching function for call to 'New(v8::Isolate*, const char*&, uint32_t&)'
         return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                       ^
    In file included from ../src/bufferutil.cc:10:0:
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:31:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
     NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                            ^
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:31:40: note:   conversion of argument 3 would be ill-formed:
    In file included from ../src/bufferutil.cc:16:0:
    ../node_modules/nan/nan.h:672:67: error: invalid conversion from 'uint32_t {aka unsigned int}' to 'node::encoding' [-fpermissive]
         return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                       ^
    In file included from ../src/bufferutil.cc:10:0:
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
     NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                            ^
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:43:40: note:   conversion of argument 2 would be ill-formed:
    In file included from ../src/bufferutil.cc:16:0:
    ../node_modules/nan/nan.h:672:67: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
         return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                       ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(uint32_t)':
    ../node_modules/nan/nan.h:676:29: error: could not convert 'node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))' from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
         return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                 ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanBufferUse(char*, uint32_t)':
    ../node_modules/nan/nan.h:683:12: error: 'Use' is not a member of 'node::Buffer'
         return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
                ^
    make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
    make: Leaving directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil/build'
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/home/username/.linuxbrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
    gyp ERR! stack     at emitTwo (events.js:87:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Linux 3.13.0-66-generic
    gyp ERR! command "/home/username/.linuxbrew/Cellar/node/4.2.1/bin/node" "/home/username/.linuxbrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil
    gyp ERR! node -v v4.2.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok 
    
    > utf-8-validate@1.1.0 install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/utf-8-validate
    > node-gyp rebuild
    
    make: Entering directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/utf-8-validate/build'
      CXX(target) Release/obj.target/validation/src/validation.o
    In file included from ../src/validation.cc:15:0:
    ../node_modules/nan/nan.h:261:25: error: redefinition of 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)'
     NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                             ^
    ../node_modules/nan/nan.h:256:25: note: 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)' previously declared here
     NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                             ^
    ../node_modules/nan/nan.h:661:13: error: 'node::smalloc' has not been declared
         , node::smalloc::FreeCallback callback
                 ^
    ../node_modules/nan/nan.h:661:35: error: expected ',' or '...' before 'callback'
         , node::smalloc::FreeCallback callback
                                       ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)':
    ../node_modules/nan/nan.h:665:50: error: 'callback' was not declared in this scope
             v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                      ^
    ../node_modules/nan/nan.h:665:60: error: 'hint' was not declared in this scope
             v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                                ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)':
    ../node_modules/nan/nan.h:672:67: error: no matching function for call to 'New(v8::Isolate*, const char*&, uint32_t&)'
         return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                       ^
    In file included from ../src/validation.cc:10:0:
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:31:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
     NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                            ^
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:31:40: note:   conversion of argument 3 would be ill-formed:
    In file included from ../src/validation.cc:15:0:
    ../node_modules/nan/nan.h:672:67: error: invalid conversion from 'uint32_t {aka unsigned int}' to 'node::encoding' [-fpermissive]
         return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                       ^
    In file included from ../src/validation.cc:10:0:
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
     NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                            ^
    /home/username/.node-gyp/4.2.1/include/node/node_buffer.h:43:40: note:   conversion of argument 2 would be ill-formed:
    In file included from ../src/validation.cc:15:0:
    ../node_modules/nan/nan.h:672:67: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
         return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                       ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(uint32_t)':
    ../node_modules/nan/nan.h:676:29: error: could not convert 'node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))' from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
         return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                 ^
    ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanBufferUse(char*, uint32_t)':
    ../node_modules/nan/nan.h:683:12: error: 'Use' is not a member of 'node::Buffer'
         return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
                ^
    make: *** [Release/obj.target/validation/src/validation.o] Error 1
    make: Leaving directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/utf-8-validate/build'
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/home/username/.linuxbrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
    gyp ERR! stack     at emitTwo (events.js:87:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Linux 3.13.0-66-generic
    gyp ERR! command "/home/username/.linuxbrew/Cellar/node/4.2.1/bin/node" "/home/username/.linuxbrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/username/.linuxbrew/lib/node_modules/appium/node_modules/ws/node_modules/utf-8-validate
    gyp ERR! node -v v4.2.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok 
    npm WARN optional dep failed, continuing bufferutil@1.1.0
    npm WARN optional dep failed, continuing utf-8-validate@1.1.0
    
    > utf-8-validate@1.2.1 install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
    > node-gyp rebuild
    
    make: Entering directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build'
      CXX(target) Release/obj.target/validation/src/validation.o
      SOLINK_MODULE(target) Release/obj.target/validation.node
      COPY Release/validation.node
    make: Leaving directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build'
    
    > bufferutil@1.2.1 install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
    > node-gyp rebuild
    
    make: Entering directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build'
      CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
      SOLINK_MODULE(target) Release/obj.target/bufferutil.node
      COPY Release/bufferutil.node
    make: Leaving directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build'
    
    > utf-8-validate@1.2.1 install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
    > node-gyp rebuild
    
    make: Entering directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build'
      CXX(target) Release/obj.target/validation/src/validation.o
      SOLINK_MODULE(target) Release/obj.target/validation.node
      COPY Release/validation.node
    make: Leaving directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build'
    
    > bufferutil@1.2.1 install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
    > node-gyp rebuild
    
    make: Entering directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build'
      CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
      SOLINK_MODULE(target) Release/obj.target/bufferutil.node
      COPY Release/bufferutil.node
    make: Leaving directory `/home/username/.linuxbrew/lib/node_modules/appium/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build'
    npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
    npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
    npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
    npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
    npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
    npm WARN peerDependencies The peer dependency continuation-local-storage@~3 included from cls-bluebird will no
    npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
    npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
    npm WARN peerDependencies The peer dependency bluebird@>=1.0.3 included from cls-bluebird will no
    npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
    npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
    /
    > appium-chromedriver@2.3.2 install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/appium-chromedriver
    > node install-npm.js
    
    info Chromedriver Install Opening temp file to write chromedriver_linux64 to...
    info Chromedriver Install Downloading http://chromedriver.storage.googleapis.com/2.18/chromedriver_linux64.zip...
    info Chromedriver Install Writing binary content to /tmp/1151012-17037-1mkrlkq/chromedriver_linux64.zip...
    info Chromedriver Install Extracting /tmp/1151012-17037-1mkrlkq/chromedriver_linux64.zip to /tmp/1151012-17037-1mkrlkq/chromedriver_linux64
    info Chromedriver Install Creating /home/username/.linuxbrew/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux...
    info Chromedriver Install Copying unzipped binary, reading from /tmp/1151012-17037-1mkrlkq/chromedriver_linux64/chromedriver...
    info Chromedriver Install Writing to /home/username/.linuxbrew/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64...
    info Chromedriver Install /home/username/.linuxbrew/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64 successfully put in place
    /home/username/.linuxbrew/bin/appium -> /home/username/.linuxbrew/lib/node_modules/appium/bin/appium.js
    /home/username/.linuxbrew/bin/appium-doctor -> /home/username/.linuxbrew/lib/node_modules/appium/bin/appium-doctor.js
    /home/username/.linuxbrew/bin/authorize_ios -> /home/username/.linuxbrew/lib/node_modules/appium/bin/authorize-ios.js
    appium@1.4.14 /home/username/.linuxbrew/lib/node_modules/appium
    ├── camel-back-promise@1.0.0
    ├── path@0.11.14
    ├── bufferpack@0.0.6
    ├── vargs@0.1.0
    ├── win-spawn@2.0.0
    ├── stack-trace@0.0.9
    ├── q@1.1.2
    ├── utf7@1.0.0
    ├── uuid-js@0.7.5
    ├── bytes@1.0.0
    ├── xpath@0.0.9
    ├── underscore@1.8.3
    ├── node-idevice@0.1.5
    ├── async@0.9.2
    ├── xmldom@0.1.19
    ├── rimraf@2.2.8
    ├── through@2.3.8
    ├── js2xmlparser2@0.2.0
    ├── bplist-parser@0.1.0
    ├── adm-zip@0.4.7
    ├── node-uuid@1.4.3
    ├── ncp@2.0.0
    ├── colors@1.0.3
    ├── safari-launcher@2.0.5
    ├── es6-promise@2.3.0
    ├── temp@0.8.3 (os-tmpdir@1.0.1)
    ├── difflib@0.2.4 (heap@0.2.6)
    ├── sandboxed-module@2.0.3 (require-like@0.1.2)
    ├── appium-atoms@0.0.5
    ├── which@1.2.0 (is-absolute@0.1.7)
    ├── mv@2.0.3 (ncp@0.6.0)
    ├── touch@0.0.3 (nopt@1.0.10)
    ├── mkdirp@0.5.1 (minimist@0.0.8)
    ├── morgan@1.5.3 (basic-auth@1.0.3, depd@1.0.1, on-finished@2.2.1, debug@2.2.0)
    ├── method-override@2.3.5 (methods@1.1.1, vary@1.0.1, parseurl@1.3.0, debug@2.2.0)
    ├── underscore.string@3.0.3
    ├── bplist-creator@0.0.6 (stream-buffers@2.2.0)
    ├── serve-favicon@2.2.1 (fresh@0.2.4, ms@0.7.1, parseurl@1.3.0, etag@1.6.0)
    ├── date-utils@1.2.17
    ├── glob@4.4.2 (inherits@2.0.1, inflight@1.0.4, once@1.3.2, minimatch@2.0.10)
    ├── npmlog@1.1.0 (ansi@0.3.0, gauge@1.1.0, are-we-there-yet@1.0.4)
    ├── body-parser@1.12.4 (content-type@1.0.1, depd@1.0.1, qs@2.4.2, on-finished@2.2.1, raw-body@2.0.2, iconv-lite@0.4.8, debug@2.2.0, type-is@1.6.9)
    ├── express@4.11.2 (utils-merge@1.0.0, merge-descriptors@0.0.2, cookie@0.1.2, fresh@0.2.4, media-typer@0.3.0, vary@1.0.1, finalhandler@0.3.3, range-parser@1.0.3, content-disposition@0.5.0, serve-static@1.8.1, methods@1.1.1, escape-html@1.0.1, cookie-signature@1.0.5, parseurl@1.3.0, path-to-regexp@0.1.3, depd@1.0.1, qs@2.3.3, on-finished@2.2.1, debug@2.1.3, send@0.11.1, proxy-addr@1.0.8, etag@1.5.1, type-is@1.5.7, accepts@1.2.13)
    ├── winston@0.9.0 (cycle@1.0.3, eyes@0.1.8, isstream@0.1.2, pkginfo@0.3.1)
    ├── ws@0.7.2 (options@0.0.6, ultron@1.0.2)
    ├── request@2.53.0 (forever-agent@0.5.2, aws-sign2@0.5.0, caseless@0.9.0, form-data@0.2.0, tunnel-agent@0.4.1, oauth-sign@0.6.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, tough-cookie@2.2.0, qs@2.3.3, mime-types@2.0.14, combined-stream@0.0.7, http-signature@0.10.1, bl@0.9.4, hawk@2.3.1)
    ├── longjohn@0.2.9 (source-map-support@0.3.2)
    ├── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.3.1, read@1.0.7, utile@0.2.1, winston@0.8.3)
    ├── grunt-cli@0.1.13 (resolve@0.3.1, nopt@1.0.10, findup-sync@0.1.3)
    ├── unzip@0.1.11 (setimmediate@1.0.4, readable-stream@1.0.33, pullstream@0.4.1, match-stream@0.0.2, fstream@0.1.31, binary@0.3.0)
    ├── swig@1.4.2 (optimist@0.6.1, uglify-js@2.4.24)
    ├── grunt@0.4.5 (eventemitter2@0.4.14, dateformat@1.0.2-1.2.3, which@1.0.9, async@0.1.22, colors@0.6.2, getobject@0.1.0, lodash@0.9.2, hooker@0.2.3, grunt-legacy-util@0.2.0, exit@0.1.2, coffee-script@1.3.3, iconv-lite@0.2.11, underscore.string@2.2.1, nopt@1.0.10, minimatch@0.2.14, glob@3.1.21, grunt-legacy-log@0.1.2, findup-sync@0.1.3, js-yaml@2.0.5)
    ├── md5calculator@0.0.3 (crypto@0.0.3, elementtree@0.1.3, unzip@0.1.8)
    ├── binary-cookies@0.1.1 (path@0.4.10, async@0.2.10, colors@0.6.2, underscore@1.4.4, argparse@0.1.16, winston@0.6.2)
    ├── appium-uiauto@1.10.10 (argparse@0.1.16, winston@0.8.3)
    ├── socket.io@1.3.7 (debug@2.1.0, has-binary-data@0.1.3, socket.io-parser@2.2.4, socket.io-adapter@0.3.1, engine.io@1.5.4, socket.io-client@1.3.7)
    ├── namp@0.2.25 (highlight.js@8.9.1)
    ├── appium-adb@1.7.5 (underscore@1.6.0, q@1.0.1, ncp@0.5.1, appium-support@0.0.3, winston@0.7.3)
    ├── argparse@1.0.3 (sprintf-js@1.0.3, lodash@3.10.1)
    ├── appium-support@1.1.2 (bluebird@2.10.2, lodash@3.10.1)
    ├── xml2js@0.4.15 (sax@1.1.4, xmlbuilder@4.0.0)
    ├── plist@1.1.0 (util-deprecate@1.0.0, base64-js@0.0.6, xmlbuilder@2.2.1)
    ├── appium-instruments@2.0.6 (underscore@1.7.0, winston@0.8.3, appium-support@1.0.3)
    ├── appium-xcode@2.0.5 (q@1.4.1, denodeify@1.2.1, npmlog@1.2.1, source-map-support@0.2.10, asyncbox@2.3.1, lodash@3.10.1, babel-runtime@5.5.5)
    ├── node-simctl@2.1.0 (npmlog@1.2.1, source-map-support@0.2.10, appium-logger@1.1.7, es6-mapify@1.0.0, asyncbox@2.3.1, babel-runtime@5.5.5, teen_process@1.5.1)
    └── appium-chromedriver@2.3.2 (is-os@1.0.0, q@1.4.1, ps-node@0.0.4, rimraf@2.4.3, request-promise@0.4.3, source-map-support@0.3.3, appium-logger@1.1.7, request@2.65.0, asyncbox@2.3.1, lodash@3.10.1, babel-runtime@5.5.5, appium-jsonwp-proxy@1.4.1, teen_process@1.5.1)
    username@redacted:~$ 
    

edit: There is an option that I did not consider, which is that appium has actually installed correctly and I should not be concerned. When I tried later to load appium, it appears to load, although I have not tried to use it for mobile testing. My question, if this output does mean that it's working then, is what's with all the errors. I went through a similar process to install Appium on MacOSX and I didn't see all those errors then. Why are there errors with this install? Is it installed but this output exposes bugs?

Community
  • 1
  • 1
TinyGrasshopper
  • 2,190
  • 2
  • 17
  • 28

4 Answers4

0

In my opinion it is easier to just checkout GIT project of Appium. After that you can run ./reset.sh to set it up & verify.

0

I saw similar errors during install but mocha android-simple.js from the Appium node examples passed (using a real phone).

Paul
  • 527
  • 5
  • 17
0

STEPS FOR INSTALLATION: My system is: 3.19.0-58-generic #64~14.04.1-Ubuntu


Please download and install Android SDK, Java JDK before embarking on this epic journey


Add the following to the ~./bashrc:

ANDROID_HOME=/home/myloc/Android/Sdk 
export PATH=$PATH:/home/myloc/Android/Sdk/tools

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH

#Setup linux brew 
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH" 
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

These are some of the items that you have to install in order: ruby -> linuxbrew -> node -> appium

$ sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
$ brew update
$ brew install node
$ brew link node
$ npm install -g node-gyp

Check-out Appium from github repo (or tagged version, mine was directly from master after tag: 1.5.1 on Apr-9-2016):

$ git clone https://github.com/appium/appium.git 
$ cd appium_checkout_from_git_location
$ npm install

Enter the commands below if there are issues with gyp rebuild:

$ rm -rf ~/.node_gyp
$ cd appium_checkout_from_git
$ npm install
$ npm rebuild

If those are still not working type the below command to help yourselves to narrow down any issues in the checked out git repo:

$ node bin/appium-doctor.js --dev

Hope this helps somebody, especially since the reset.sh script has been removed since version 1.5 of Appium.

My References:

  1. https://askubuntu.com/questions/729047/how-to-install-and-configure-appium-in-ubuntu (Answer by Mark Kirby, i dont have enough points to upvote him :( )
  2. common.gypi not found error in node.js (Answer by Jedininjaster , i dont have enough points to upvote him too)
Community
  • 1
  • 1
Dinesh Kumar
  • 307
  • 1
  • 3
  • 9
0

Remember Appium throws error if you install via SUDO . So install Appium via npm ,to install Appium via an npm install you need node.js and npm 0.12 or greater. Make sure you have not installed Node or Appium with sudo. To install node.js and appium without sudo we use linuxbrew. Following are the detailed steps to install Appium on Ubuntu 14.04OS.

To install linuxbrew these are the dependencies Ruby 1.8.6 or newer GCC 4.2 or newer Git 1.7.12.4 or newer Linux 2.6.16 or newer 64-bit x86 or 32-bit ARM platform

Installation Steps 1.Install Ruby (Copy the command to terminal and press enter)

sudo apt-get install build-essential curl git m4 python-setuptools ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
  1. Install Linux Brew:(Copy the command to terminal and press enter)

    ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"

3.Set Path for brew Type sudo gedit.bashrc in terminal and copy the below in the .bashrc file.export PATH="$HOME/.linuxbrew/bin:$PATH"export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

4.Install Node:Open new terminal and copy the command and press enter

brew update
brew install node
brew link node

You may face the error as below while installing node:

==> make install
Last 15 lines from /home/tsepak/.cache/Homebrew/Logs/node/02.make:
../deps/v8/src/base/platform/mutex.h:170:3: error: ‘void v8::operator=(const v8::RecursiveMutex&)’ must be a nonstatic member function
../deps/v8/src/base/platform/mutex.h:184:9: error: ‘LazyStaticInstance’ does not name a type
../deps/v8/src/base/platform/mutex.h:202:17: error: template declaration of ‘LockGuard final’
../deps/v8/src/base/platform/mutex.h:203:2: error: expected primary-expression before ‘public’
../deps/v8/src/base/platform/mutex.h:203:2: error: expected ‘}’ before ‘public’
../deps/v8/src/base/platform/mutex.h:205:14: error: declaration of ‘~LockGuard’ as non-member
../deps/v8/src/base/platform/mutex.h:207:2: error: expected unqualified-id before ‘private’
../deps/v8/src/base/platform/mutex.h:210:3: error: expected unqualified-id before ‘const’
../deps/v8/src/base/platform/mutex.h:210:3: error: expected ‘)’ before ‘const’
../deps/v8/src/base/platform/mutex.h:210:3: error: ‘void operator=(const LockGuard&)’ must be a nonstatic member function
../deps/v8/src/base/platform/mutex.h:211:1: error: expected declaration before ‘}’ token
make[1]: *** [/tmp/node20160122-19291-3znamd/node-v5.4.1/out/Release/obj.target/v8_libplatform/deps/v8/src/libplatform/default-platform.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/tmp/node20160122-19291-3znamd/node-v5.4.1/out’
make: *** [node] Error 2
READTHIS:https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting

*******This is a compiler issue.If you try to build with an incompatible compiler you will face above error which is a open issue in Git.Try the below update gcc to 4.9 or try brew install node --cc=gcc-5****

Even if this does'nt work uninstall linuxbrew and start from fresh.

5.Finally Install Appium: Appium is installed via npm There are two ways to install npm packages :locally or globally. For appium we need to install npm packages globally.

npm install -g appium

6.Let's Check if the installation is successfull. Open the terminal and type "appium" and hit enter appium

You should see something like this in the terminal

info: Welcome to Appium v1.4.12(REV 8db2d00b9afcf2c50a09a80a2e8d56b05a902caf)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
anuja jain
  • 1,367
  • 13
  • 19