使用 npm install -g appium 安装 appium 时未找到 .bin/authorize-ios

MPe*_*ira 9 macos appium npm-install appium-ios

当我尝试使用安装 appium 时 npm install -g appium

我收到消息

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
Run Code Online (Sandbox Code Playgroud)

如果我再次运行安装,我会得到

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
Run Code Online (Sandbox Code Playgroud)

第一个 .bin/authorize-ios 确实不存在。我不知道如何修复它。当我使用npm install appium-ios-driver驱动程序安装时,安装User/node_modulesusr/local/lib/node_modules. 我使用 brew 安装了 npm。

Bor*_*per 10

我能够通过安装 NPM 6(撰写本文时为 6.14.9)来解决这个问题

npm i -g npm@6
npm i -g appium
Run Code Online (Sandbox Code Playgroud)

如果你想锁定特定版本的 npm 而不是最新版本,那么这应该会让你找到一个应该安装它的版本

npm i -g npm@6.14.9
Run Code Online (Sandbox Code Playgroud)


小智 -1

看起来像是权限问题,建议您从头开始重试:

  • npm uninstall -g appium 或者直接删除/usr/local/bin/appium
  • npm install -g appium@1.18.3

安装 appium-doctor 来检查您的系统是否已正确设置 Appium 的所有内容也是有意义的:npm install -g appium-doctor

您可以在此处查看详细设置