运行appium报错:Appium will not work if used or installed with sudo ?

error: Appium will not work if used or installed with sudo. Please rerun/install as a non-root user. If you had to install Appium using `sudo npm install -g appium`, the solution is to reinstall Node using a method (Homebrew, for example) that doesn't require sudo to install global npm packages.

 

    最佳答案
  1. #1

    stady(回复于:2018-03-30 09:03:43)

    出错原因:
    权限问题,无法使用sudo来运行appium
    解决办法:
    步骤1、改变node的所有者
    cd /usr/local/lib
    sudo chown -R [username] node_modules
    步骤2、卸载appium
    npm uninstall appium -g
    步骤3、重新安装appium
    npm install -g appium
    步骤4. 启动
    appium &
    步骤5. 查看是否运行成功
    浏览器打开:
    http://0.0.0.0:4723/
    显示:
    That URL did not map to a valid JSONWP resource
    说明成功



我的回答