通过 npm 安装 appium 时出现此错误。
node -v: 9.8.0
npm -v: 5.6.0
[root@localhost lib]# npm install -g appium
/usr/bin/appium -> /usr/lib/node_modules/appium/build/lib/main.js
appium-chromedriver@3.1.4 install /usr/lib/node_modules/appium/node_modules/appium-chromedriver node install-npm.js
(node:5249) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/2018221-5249-kiftlj.jre1h'
(node:5249) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5249) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
info Chromedriver Install Installing Chromedriver version '2.33' for platform 'linux' and architecture '64'
info Chromedriver Install Opening temp file to write chromedriver_linux64 to...
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/2018221-5249-17cdgfv.7e26i'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/appium/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver@3.1.4 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@3.1.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-03-21T12_34_01_555Z-debug.log