Whole load of errors attempting to npm install wd. Everything else installed fine!

Hi,

Just setting up appium on OSX 10.10.3 with XCode 6.3.1

After installing Homebrew I followed the instructions on appium.io:

brew install node # get node.js
npm install -g appium # get appium
> npm install wd # get appium client
appium & # start appium

All installed perfectly except wd which produces the following:

$ npm install wd
npm ERR! tar.unpack untar error /Users/myuser/.npm/wd/0.3.11/package.tgz
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "wd"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.5
npm ERR! path /node_modules
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/node_modules'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, mkdir '/node_modules']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/node_modules',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/node_modules/wd',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171: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 this command again as root/Administrator.**
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "wd"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.5

npm ERR! Uncaught, unspecified "error" event.
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

There’s a clue in there “npm ERR! Please try running this command again as root/Administrator.” but on the main appium site it says not to install as sudo or root (which I’ve not been).

I’ve spun up appium form the command line - OK. Run appium Doctor in the GUI tool. All OK.

Can anyone help with the wd issue at all please?

Thanks in advance.

Steve

Hi Steve,

I has the same issue and saw your question come up when I Googled it. I hope by now you were able to solve it but if not, and for reference to future visitors to this page, I found there’s a fairly straight forward solution that worked for me and seems to work for others:

Simply run:

$ npm cache clean

Restart Terminal and then try again:

$ npm install wd

Hope this helps!

Dan

Please help.

I faced similar error while installing appium.

$npm cache clean did not work for me.

Error:

toral@toral:~$ npm install -g appium
npm ERR! tar.unpack untar error /tmp/npm-11648-e67e675b/registry.npmjs.org/appium-uiauto/-/appium-uiauto-1.10.8.tgz
npm ERR! tar.unpack untar error /tmp/npm-11648-e67e675b/registry.npmjs.org/appium-instruments/-/appium-instruments-2.0.5.tgz
npm ERR! Linux 3.5.0-23-generic
npm ERR! argv “/home/toral/node/node-v0.12.7-linux-x64/bin/node” “/home/toral/node/node-v0.12.7-linux-x64/bin/npm” “install” “-g” “appium”
npm ERR! node v0.12.7
npm ERR! npm v2.11.3

npm ERR! unexpected eof
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /home/toral/npm-debug.log
toral@toral:~$

What is this “tar.unpack untar error” ?