appium未能启动 - 未被捕获的错误工具

时间:2015-10-12 11:34:28

标签: ios node.js module appium

启动Appium GUI工具时,重新安装我的整个mac后,我遇到以下错误:

  

/Applications/Appium.app/Contents/Resources/node/bin/node'   ' /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js'

     

错误:uncaughtException:无法找到模块和appium-instruments'   date = Mon Oct 12 2015 14:14:28 GMT + 0300(EEST),pid = 444,   uid = 1525045707,gid = 1275180346,   CWD = /应用/ Appium.app /内容/资源/ node_modules / appium,   execPath = /应用/ Appium.app /内容/资源/节点/斌/节点,   版本= v0.12.7,   的argv = [/应用/ Appium.app /内容/资源/节点/ bin中/节点,   /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js]   rss = 80273408,heapTotal = 62810368,heapUsed = 41559528,   loadavg = [2.0048828125,1.67975390625,0.82421875],正常运行时间= 279,   trace = [column = 15,file = module.js,   function = Function.Module._resolveFilename,line = 336,   method = Module._resolveFilename,native = false,column = 25,   file = module.js,function = Function.Module._load,line = 278,   method = Module._load,native = false,column = 17,file = module.js,   function = Module.require,line = 365,method = require,native = false,   column = 17,file = module.js,function = require,line = 384,method = null,   native = false,column = 14,   文件= /应用/ Appium.app /内容/资源/ node_modules / appium / lib目录/设备/ IOS / instruments.js,   function =,line = 4,method = null,native = false,column = 26,   file = module.js,function = Module._compile,line = 460,method = _compile,   native = false,column = 10,file = module.js,   function = Object.Module._extensions..js,line = 478,   method = Module._extensions..js,native = false,column = 32,   file = module.js,function = Module.load,line = 355,method = load,   native = false,column = 12,file = module.js,   function = Function.Module._load,line = 310,method = Module._load,   native = false,column = 17,file = module.js,function = Module.require,   line = 365,method = require,native = false,column = 17,file = module.js,   function = require,line = 384,method = null,native = false,column = 19,   文件= /应用/ Appium.app /内容/资源/ node_modules / appium / lib目录/设备/ IOS / ios.js,   function =,line = 15,method = null,native = false,column = 26,   file = module.js,function = Module._compile,line = 460,method = _compile,   native = false,column = 10,file = module.js,   function = Object.Module._extensions..js,line = 478,   method = Module._extensions..js,native = false,column = 32,   file = module.js,function = Module.load,line = 355,method = load,   native = false,column = 12,file = module.js,   function = Function.Module._load,line = 310,method = Module._load,   native = false],stack = [错误:无法找到模块' appium-instruments',   在Function.Module._resolveFilename(module.js:336:15),at   Function.Module._load(module.js:278:25),在Module.require   (module.js:365:17),在require(module.js:384:17),在Object。   (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/instruments.js:4:14),   在Module._compile(module.js:460:26),at   Object.Module._extensions..js(module.js:478:10),在Module.load   (module.js:355:32),在Function.Module._load(module.js:310:12),at   Module.require(module.js:365:17),at require(module.js:384:17),at   宾语。   (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:15:19),   在Module._compile(module.js:460:26),at   Object.Module._extensions..js(module.js:478:10),在Module.load   (module.js:355:32),在Function.Module._load(module.js:310:12)]

如果您遇到此问题并知道解决错误的解决方案,请告诉我

4 个答案:

答案 0 :(得分:7)

cd /Applications/Appium.app/Contents/Resources/node_modules/appium
npm install

答案 1 :(得分:1)

我今天遇到了同样的问题。我的配置是Appium 1.4.13和Xcode Version 7.0.1(7A1001)。

在此链接https://github.com/appium/appium-dot-app/issues/510中,提议的解决方案似乎比从旧版本添加模块更“干净”。

建议更改Appium.app/Contents/Resources/node_modules/appium/node_modules中包含的所有符号链接的目标,以指向相对../submodules文件夹中包含的模块。

我使用了以下命令行来修改那里的所有符号链接:

cd /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules
ln -f -s ../submodules/appium-instruments/ appium-instruments

但它并没有完全修复,我和@Igal有同样的问题:

dyld: could not load inserted library '/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib' because no suitable image found. Did find:
/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib: mmap() error 1 at address=0x104497000, size=0x00001000 segment=__TEXT in Segment::map() mapping /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib

我使用此处提出的解决方案修复了它:https://github.com/appium/appium/issues/5720 即从coommand行启动Appium时使用以下标志:

--native-instruments-lib 

在GUI中,您也可以添加它:开发人员设置>自定义服务器标记。

答案 2 :(得分:1)

我遇到了同样的问题,得到了答案:https://github.com/appium/appium-dot-app/issues/512。 转到/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules,并将链接文件目标更改为' / usr / local / lib / node_modules / appium / node_modules / xxxx'

答案 3 :(得分:0)

从1.4.8升级到1.4.13后出现确切错误。删除1.4.13并重新安装1.4.8并重新启动并再次运行。

通过从1.4.8 /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules复制丢失的节点库并粘贴到1.4.13的同一文件夹来实现它。

也许1.4.13的版本无法正确打包。