npm - Trying to use Appium on Ubuntu but getting node.js:134 error -
i've installed node with
sudo apt-get install -y nodejs
and appium with
sudo npm install -g appium
in both cases forced use sudo
on ubuntu. appium page @ https://github.com/appium/appium/blob/master/readme.md says don't use sudo
believe ubuntu it's ok (and necessary) use sudo
directed on node page @ https://github.com/joyent/node/wiki/installing-node.js-via-package-manager
when try , start appium appium &
or just
appium
i get
$ appium node.js:134 throw e; // process.nexttick error, or 'error' event on first tick ^ typeerror: object prototype may object or null @ function.create (native) @ object.inherits (util.js:425:27) @ object.<anonymous> (/usr/lib/node_modules/appium/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js:63:6) @ module._compile (module.js:402:26) @ object..js (module.js:408:10) @ module.load (module.js:334:31) @ function._load (module.js:293:12) @ require (module.js:346:19) @ object.<anonymous> (/usr/lib/node_modules/appium/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js:1:90) @ module._compile (module.js:402:26)
i upgraded node hasn't seemed help:
$ node -v v0.12.2 15:04:28 durrantm castle2012 /home/durrantm/dropbox/_/appium_mobile_testing/appium master $ appium error: appium not work if used or installed sudo. please rerun/install non-root user. if had install appium using `sudo npm install -g appium`, solution reinstall node using method (homebrew, example) doesn't require sudo install global npm packages.
however when uninstall node , try re-installing without sudo, indicated, get:
$ apt-get install nodejs e: not open lock file /var/lib/dpkg/lock - open (13: permission denied) e: unable lock administration directory (/var/lib/dpkg/), root?
i tried building node source locally with
$ mkdir ~/local $ ./configure --prefix=~/local creating ./icu_config.gypi { 'target_defaults': { 'cflags': [], 'default_configuration': 'release', 'defines': [], 'include_dirs': [], 'libraries': []}, 'variables': { 'clang': 0, 'gcc_version': 48, 'host_arch': 'x64', 'icu_small': 'false', 'node_install_npm': 'true', 'node_prefix': '/home/durrantm/local', 'node_shared_cares': 'false', 'node_shared_http_parser': 'false', 'node_shared_libuv': 'false', 'node_shared_openssl': 'false', 'node_shared_v8': 'false', 'node_shared_zlib': 'false', 'node_tag': '', 'node_use_dtrace': 'false', 'node_use_etw': 'false', 'node_use_mdb': 'false', 'node_use_openssl': 'true', 'node_use_perfctr': 'false', 'openssl_no_asm': 0, 'python': '/usr/bin/python', 'target_arch': 'x64', 'uv_library': 'static_library', 'uv_parent_path': '/deps/uv/', 'uv_use_dtrace': 'false', 'v8_enable_gdbjit': 0, 'v8_enable_i18n_support': 0, 'v8_no_strict_aliasing': 1, 'v8_optimized_debug': 0, 'v8_random_seed': 0, 'v8_use_snapshot': 'true', 'want_separate_host_toolset': 0}} creating ./config.gypi creating ./config.mk $ make ... $ make install ...
but didn't seem help:
$ npm install -g appium npm err! tar.unpack untar error /home/durrantm/.npm/appium/1.3.7/package.tgz npm err! linux 3.13.0-49-generic npm err! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "appium" npm err! node v0.12.2 npm err! npm v2.7.4 npm err! path /usr/local/lib/node_modules/appium npm err! code eacces npm err! errno -13 npm err! error: eacces, mkdir '/usr/local/lib/node_modules/appium' npm err! @ error (native) npm err! { [error: eacces, mkdir '/usr/local/lib/node_modules/appium'] npm err! errno: -13, npm err! code: 'eacces', npm err! path: '/usr/local/lib/node_modules/appium', npm err! fstream_type: 'directory', npm err! fstream_path: '/usr/local/lib/node_modules/appium', npm err! fstream_class: 'dirwriter', npm err! fstream_stack: npm err! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23', npm err! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53', npm err! 'fsreqwrap.oncomplete (fs.js:95:15)' ] } npm err! npm err! please try running command again root/administrator. npm err! please include following file support request: npm err! /home/durrantm/downloads/node/npm-debug.log 15:47:13 durrantm castle2012 /home/durrantm/downloads/node master $ appium error: appium not work if used or installed sudo. please rerun/install non-root user. if had install appium using `sudo npm install -g appium`, solution reinstall node using method (homebrew, example) doesn't require sudo install global npm packages.
i did
sudo chown -r $(whoami) ~/.npm
and
sudo npm install -g appium ... lots of compile outpout, not errors, seems ok ...
but still get
$ appium error: appium not work if used or installed sudo. please rerun/install non-root user. if had install appium using `sudo npm install -g appium`, solution reinstall node using method (homebrew, example) doesn't require sudo install global npm packages.
as mentioned, appium should not installed sudo. , won't recommend install node via apt, didn't work me.
better use homebrew - allow install appium home directory without sudo. try following:
uninstall node installed apt:
sudo apt-get remove node
follow instructions , install homebrew. after install node with:
brew install node
now try:
npm install -g appium
and if you'll face permissions issues .npm folder in home path, use sudo chown -r $(whoami) ~/.npm
mentioned.
Comments
Post a Comment