9

When I try to install appium using npm install -g appium

I get the message

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/appium/node_modules/.bin/authorize-ios
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/appium/node_modules/.bin/authorize-ios'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

If I run the install again I get

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/appium/build/lib/main.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/appium/build/lib/main.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

The first .bin/authorize-ios is indeed not there. I don't know how to fix it. When I install using npm install appium-ios-driver the driver is installed under User/node_modules and not at usr/local/lib/node_modules. I installed npm using brew.

MPereira
  • 113
  • 1
  • 8

4 Answers4

10

I was able to solve this by installing the NPM 6 (6.14.9 as of this writing)

npm i -g npm@6
npm i -g appium

If you want to lock into a particular version of npm instead of latest then this should get you to a version that should install it

npm i -g npm@6.14.9
Dave Mackey
  • 4,306
  • 21
  • 78
  • 136
BoredAndroidDeveloper
  • 1,251
  • 1
  • 11
  • 26
  • 1
    `npm i -g npm@latest` worked for me. It changed version on `npm` to `6.14.9` form `7.0.14` – Yanny Dec 01 '20 at 11:48
  • Note this was a bug in appium that it did not support >= npm7. It has since been fixed but not sure what version will contain the fix: https://github.com/appium/appium/issues/14901 – BoredAndroidDeveloper Dec 24 '20 at 16:23
  • Unfortunately, the above did not work for me, still getting the same error message. – Dave Mackey Feb 14 '21 at 21:05
  • 1
    Update: `npm i -g npm@latest` now installs npm 7, so you'll need to explicitly specify you want npm 6: `npm i -ig npm@6` – Dave Mackey Feb 14 '21 at 21:28
0

authorize-ios is deprecated. appium authorize-ios

removing appium, updating npm, cleaning the cache and re-installing appium via npm worked for us on this issue(updated 4 build agents this way successfully).

npm uninstall -g appium && npm install -g npm && npm clean cache --force && npm install -g appium
medright
  • 138
  • 10
-1

It looks like a permission issue, I suggest you try it again from scratch:

  • npm uninstall -g appium or just go and delete /usr/local/bin/appium
  • npm install -g appium@1.18.3

It also makes sense to install appium-doctor to inspect your system has everything setup properly for Appium: npm install -g appium-doctor

You can check detailed setup here

dmle
  • 3,498
  • 1
  • 14
  • 22
-3

you can use appium desktop, It is very easy, just install and edit configuration(andorid sdk path and jdk path) and start server.

Ellie
  • 11
  • 2