我在Ubuntu上安裝appium時遇到問題。我嘗試了正常的apt-get安裝方式,發現我不應該那樣做。所以我卸載節點,然後從appium apt-get和我嘗試在這些線程如何在Ubuntu上安裝appium?
How to setup Appium in Ubuntu for android
How to install and run appium in linux?
我做了以下
安裝RVM列出的指令的變化
\curl -sSL https://get.rvm.io | bash -s stable --ruby
安裝Ruby與RVM
rvm install 2.2.3
讓我的殼在終端仿真器的選項登錄shell(我使用的終結者,而不是常規的終端)RVM說要做到這一點,而不是
rvm --default use 2.2.3
當我試圖運行rvm --default時。安裝rvm時安裝的ruby是2.2.1,所以在這一點上我使用Ruby的2.2.1。從其他問題線程安裝依賴包。我只是這樣做,因爲其他線程做到了這一點。
sudo apt-get install build-essential curl m4 texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
從這裏https://github.com/Homebrew/linuxbrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
安裝Linux的自制讓Linux自制軟件啓動和運行
brew doctor
brew install git
(我不得不這樣做BEC ause brew doctor說我的git太舊了)安裝節點的依賴包。我不得不這樣做,因爲當我試圖運行
brew install node
它失敗了關於缺少頭文件的編譯錯誤。當我用Google搜索該文件名,有人提到,這需要該文件sudo apt-get install libx11-dev
與釀造安裝gcc包。我必須這樣做,因爲在安裝軟件包後嘗試
brew install node
之後,我得到了進一步的編譯錯誤。我查了自制軟件github https://github.com/Homebrew/linuxbrew/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+node上的節點錯誤,並說這個錯誤https://github.com/Homebrew/linuxbrew/issues/597說用gcc 5來安裝節點。當我嘗試這個命令時,它說我的gcc太舊了(它是4.6)並且用brew安裝gcc5。brew install gcc
安裝節點
brew install node --cc=gcc-5
此時BREW和節點安裝。然後我試着去安裝appium。全球和非全球,他們都失敗了,這是一個巨大的編譯錯誤。 (我不知道如何使stackoverflow的東西把代碼作爲原始文本)。當然,在這一點上,我的智慧已經結束了,我不知道如何使節點編譯appium正確。我不知道如何閱讀這些編譯錯誤並追查他們的真正根源。我將在節點和appium上提交一個錯誤並將其粘貼回來。任何援助將不勝感激。
[email protected]:~$ npm install -g appium npm WARN optional dep failed, continuing [email protected] npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.1","npm":"2.14.7"}) > [email protected] 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 > [email protected] 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 [email protected] npm WARN optional dep failed, continuing [email protected] > [email protected] 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' > [email protected] 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' > [email protected] 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' > [email protected] 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 [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"}) npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"}) npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"}) npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"}) npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"4.2.1","npm":"2.14.7"}) npm WARN peerDependencies The peer dependency [email protected]~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 [email protected]>=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. / > [email protected] 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 [email protected] /home/username/.linuxbrew/lib/node_modules/appium ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected]2.4.24) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) [email protected]:~$
編輯:沒有,我沒有考慮,這是appium實際上已經正確安裝,我不應該關注的一個選項。當我稍後嘗試加載appium時,似乎會加載,儘管我沒有嘗試將其用於移動測試。我的問題是,如果這個輸出確實表明它正在工作,那麼所有的錯誤都是如此。我經歷了一個類似的過程來在MacOSX上安裝Appium,然後我沒有看到所有這些錯誤。爲什麼安裝時出現錯誤?它是否安裝,但這個輸出暴露錯誤?