解决Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/appium/node_module

解决安装或更新appium:

一般使用 

sudo npm install -g appium

但在下载的过程中会碰到下面错误:

> appium-selendroid-driver@1.13.4 install /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver
> node ./bin/install.js

(node:75893) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/201969-75893-ik2f62.u3yn'
(node:75893) 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:75893) [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.
[13:53:33] Java version 1.8.0_181 found
[13:53:33] Ensuring /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
[13:53:33] Selendroid setup files did not yet exist, waiting...
[13:53:35] Java version 1.8.0_181 found
[13:53:35] Ensuring /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
[13:53:35] Selendroid setup files did not yet exist, waiting...
[13:53:37] Java version 1.8.0_181 found
[13:53:37] Ensuring /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
[13:53:37] Selendroid setup files did not yet exist, waiting...
[13:53:38] Java version 1.8.0_181 found
[13:53:39] Ensuring /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
[13:53:39] Selendroid setup files did not yet exist, waiting...

然后一直处于一个不断循环的状态;

此时使用这条命令,一下解决你的问题!

sudo npm install -g appium --unsafe-perm=true --allow-root

超爽的!

  • 12
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值