BillBie

导航

appium 出现error: Unhandled error: ReferenceError: grep is not defined 时

 

error: Unhandled error: ReferenceError: grep is not defined
>     at [object Object].ADB.shell (E:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:192:46)
>     at [object Object].<anonymous> (E:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:942:16)
>     at [object Object].<anonymous> (E:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
>     at ChildProcess.exithandler (child_process.js:742:7)
>     at ChildProcess.emit (events.js:110:17)
>     at maybeClose (child_process.js:1016:16)
>     at Process.ChildProcess._handle.onexit (child_process.js:1088:5) context: [POST /wd/hub/session {"capabilities":{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:62001","appium:platformVersion":"5.0","appium:appPackage":" com.tencent.mm","appium:appActivity":"com.tencent.mm]

 

出现这个错误一般是appium 版本过低(1.4.16),此时升级appium:

npm update -g appium

如果出现错误,

则可以

那么就先卸载appium

步骤一:cmd命令行中 执行npm uninstall -g appium (卸载appnium)

步骤二:cmd命令行中执行 npm cache clean (清理cache缓存)

步骤三:cmd命令行中执行 npm install -g appium  (安装appium)

如果还是不行,写在appium后,删除appium下的所有文件,在使用npm install -g appium 安装appium

此时的版本号是:1.15.1

然后此问题可以得到解决

posted on 2019-10-18 15:26  BillBie  阅读(8)  评论(0编辑  收藏  举报