macaca icon indicating copy to clipboard operation
macaca copied to clipboard

1.1.21版本运行desktop-browser-sample-nodejs-master例子macha报错

Open DreamTear opened this issue 9 years ago • 12 comments

  • Macaca Version: 1.1.21

  • Macaca Doctor Logs: macaca-doctor version: 1.0.28

    Node.js checklist:

    node env: D:\Program Files\nodejs\node.exe node version: v6.9.2

    Android checklist:

    JAVA version is 1.6.0_45 JAVA_HOME is set to C:\Program Files\Java\jdk1.6.0_45 ANDROID_HOME is not set ANT_HOME is not set

    Installed driver list:

    chrome: 1.0.5

  • Operate System: windows 10 64bit

  • Programming Language: nodejs 下载desktop-browser-sample-nodejs-master 运行:

macaca run -d macaca-test

报错:

 webdriver sdk launched
>> E:\learn\Macaca\desktop-browser-sample-nodejs-master\node_modules\.bin\mocha:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

>> Test completed!

DreamTear avatar Feb 10 '17 10:02 DreamTear

参考下 CI的环境 https://travis-ci.org/macaca-sample/desktop-browser-sample-nodejs

xudafeng avatar Feb 10 '17 10:02 xudafeng

我在linux环境上试了下,没有报错,应该是跟操作系统环境相关

DreamTear avatar Feb 13 '17 01:02 DreamTear

https://github.com/macacajs/macaca-cli/pull/68/

xudafeng avatar Feb 15 '17 15:02 xudafeng

已修复,请升级新版cli

xudafeng avatar Feb 15 '17 15:02 xudafeng

https://github.com/alibaba/macaca/issues/359

xudafeng avatar Feb 16 '17 02:02 xudafeng

https://testerhome.com/topics/7491 Macaca Node 版关于 mocha 问题的说明

xudafeng avatar Feb 16 '17 02:02 xudafeng

if operating system environment is windows just delete node_modules.bin\mocha for windows os just mocha.cmd file is required

sachinGirish avatar Feb 16 '17 06:02 sachinGirish

macaca -v

1.1.22

webdriver sdk launched /usr/local/lib/node_modules/macaca-cli/lib/run/index.js:45 throw err; ^

Error: Cannot find test framework "mocha" in /Users/Shark/Develop/Python/automation/desktop-browser-sample-nodejs/node_modules

还是有这个问题呢。 Mac系统

dreambe avatar Feb 16 '17 08:02 dreambe

还有这个问题,请教怎么解决呢 同样是mac系统

localhost:desktop-browser-sample-nodejs Shark$ macaca run -d macaca-test/

webdriver sdk launched module.js:471 throw err; ^

Error: Cannot find module 'should' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/Users/Shark/Develop/Python/automation/desktop-browser-sample-nodejs/macaca-test/desktop-browser-sample-nodejs.test.js:3:1) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at /Users/Shark/Develop/Python/automation/desktop-browser-sample-nodejs/node_modules/mocha/lib/mocha.js:222:27 at Array.forEach (native) at Mocha.loadFiles (/Users/Shark/Develop/Python/automation/desktop-browser-sample-nodejs/node_modules/mocha/lib/mocha.js:219:14) at Mocha.run (/Users/Shark/Develop/Python/automation/desktop-browser-sample-nodejs/node_modules/mocha/lib/mocha.js:487:10) at Object. (/Users/Shark/Develop/Python/automation/desktop-browser-sample-nodejs/node_modules/mocha/bin/_mocha:459:18) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:509:3

Test completed!

dreambe avatar Feb 16 '17 09:02 dreambe

http://stackoverflow.com/questions/41235382/getting-mocha-error-in-command-prompt/42311434#42311434

xudafeng avatar Feb 18 '17 05:02 xudafeng

mac上1.1.22还有这个问题呢。。有办法解决么

xiaoxiao257 avatar Feb 20 '17 09:02 xiaoxiao257

mac 上的1.2.0也有这个问题,,,https://github.com/macaca-sample/mobile-app-sample-nodejs/issues/3

ElesG avatar Mar 15 '17 04:03 ElesG