Appium 安装了 appium 相关,使用了 appium-doctor 检查也没问题,使用 appium-v 检查也没问题,但是使用命令 appium 报错

coco · 2018年04月12日 · 2133 次阅读

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\KevinQin>appium
error: uncaughtException: Cannot find module 'internal/fs' date=Thu Apr 12 2018
09:40:00 GMT+0800 (中国标准时间), pid=13912, uid=null, gid=null, cwd=C:\Program
Files (x86)\Appium\node_modules\appium, execPath=C:\Program Files\nodejs\node.ex
e, version=v7.7.4, argv=[C:\Program Files\nodejs\node.exe, C:\Program Files (x86
)\Appium\node_modules\appium\bin\appium.js], rss=99155968, heapTotal=78966784, h
eapUsed=53383960, external=1048162, loadavg=[0, 0, 0], uptime=2754.5890568, trac
e=[column=15, file=module.js, function=Function.Module._resolveFilename, line=47
0, method=Module._resolveFilename, native=false, column=25, file=module.js, func
tion=Function.Module._load, line=418, method=Module._load, native=false, column=
17, file=module.js, function=Module.require, line=498, method=require, native=fa
lse, column=19, file=internal/module.js, function=require, line=20, method=null,
native=false, column=20, file=evalmachine., function=null, line=18,
method=null, native=false, column=1, file=x86)\Appium\node_modules\appium\node_m
odules\md5calculator\node_modules\unzip\node_modules\fstream\node_modules\gracef
ul-fs\fs.js, function=Object. (C:\Program Files, line=11, method= nymous> (C:\Program Files, native=false, column=32, file=module.js, function=Mod
ule._compile, line=571, method=_compile, native=false, column=10, file=module.js
, function=Object.Module._extensions..js, line=580, method=Module._extensions..j
s, native=false, column=32, file=module.js, function=Module.load, line=488, meth
od=load, native=false, column=12, file=module.js, function=tryModuleLoad, line=4
47, method=null, native=false, column=3, file=module.js, function=Function.Modul
e._load, line=439, method=Module._load, native=false, column=17, file=module.js,
function=Module.require, line=498, method=require, native=false, column=19, fil
e=internal/module.js, function=require, line=20, method=null, native=false, colu
mn=27, file=x86)\Appium\node_modules\appium\node_modules\md5calculator\node_modu
les\unzip\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js, function
=Object. (C:\Program Files, line=3, method= (C:\Program Fi
les, native=false, column=32, file=module.js, function=Module._compile, line=571
, method=_compile, native=false, column=10, file=module.js, function=Object.Modu
le._extensions..js, line=580, method=Module._extensions..js, native=false, colum
n=32, file=module.js, function=Module.load, line=488, method=load, native=false,
column=12, file=module.js, function=tryModuleLoad, line=447, method=null, nativ
e=false, column=3, file=module.js, function=Function.Module._load, line=439, met
hod=Module._load, native=false, column=17, file=module.js, function=Module.requi
re, line=498, method=require, native=false, column=19, file=internal/module.js,
function=require, line=20, method=null, native=false, column=10, file=x86)\Appiu
m\node_modules\appium\node_modules\md5calculator\node_modules\unzip\node_modules
\fstream\lib\reader.js, function=Object. (C:\Program Files, line=4, m
ethod= (C:\Program Files, native=false, column=32, file=module.js, fu
nction=Module._compile, line=571, method=_compile, native=false, column=10, file
=module.js, function=Object.Module._extensions..js, line=580, method=Module._ext
ensions..js, native=false, column=32, file=module.js, function=Module.load, line
=488, method=load, native=false, column=12, file=module.js, function=tryModuleLo
ad, line=447, method=null, native=false, column=3, file=module.js, function=Func
tion.Module._load, line=439, method=Module._load, native=false, column=17, file=
module.js, function=Module.require, line=498, method=require, native=false, colu
mn=19, file=internal/module.js, function=require, line=20, method=null, native=f
alse, column=18, file=x86)\Appium\node_modules\appium\node_modules\md5calculator
\node_modules\unzip\node_modules\fstream\fstream.js, function=Object.
(C:\Program Files, line=2, method= (C:\Program Files, native=false,
column=32, file=module.js, function=Module._compile, line=571, method=_compile,
native=false, column=10, file=module.js, function=Object.Module._extensions..js,
line=580, method=Module._extensions..js, native=false, column=32, file=module.j
s, function=Module.load, line=488, method=load, native=false, column=12, file=mo
dule.js, function=tryModuleLoad, line=447, method=null, native=false], stack=[Er
ror: Cannot find module 'internal/fs', at Function.Module._resolveFilename (
module.js:470:15), at Function.Module._load (module.js:418:25), at Modul
e.require (module.js:498:17), at require (internal/module.js:20:19), at
evalmachine.:18:20, at Object. (C:\Program Files (x86)
\Appium\node_modules\appium\node_modules\md5calculator\node_modules\unzip\node_m
odules\fstream\node_modules\graceful-fs\fs.js:11:1), at Module._compile (mod
ule.js:571:32), at Object.Module._extensions..js (module.js:580:10), at
Module.load (module.js:488:32), at tryModuleLoad (module.js:447:12), at
Function.Module._load (module.js:439:3), at Module.require (module.js:498:17
), at require (internal/module.js:20:19), at Object. (C:\Prog
ram Files (x86)\Appium\node_modules\appium\node_modules\md5calculator\node_modul
es\unzip\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:3:27),
at Module._compile (module.js:571:32), at Object.Module._extensions..js (mo
dule.js:580:10), at Module.load (module.js:488:32), at tryModuleLoad (mo
dule.js:447:12), at Function.Module._load (module.js:439:3), at Module.r
equire (module.js:498:17), at require (internal/module.js:20:19), at Obj
ect. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\
md5calculator\node_modules\unzip\node_modules\fstream\lib\reader.js:4:10), a
t Module._compile (module.js:571:32), at Object.Module._extensions..js (modu
le.js:580:10), at Module.load (module.js:488:32), at tryModuleLoad (modu
le.js:447:12), at Function.Module._load (module.js:439:3), at Module.req
uire (module.js:498:17), at require (internal/module.js:20:19), at Objec
t. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\md
5calculator\node_modules\unzip\node_modules\fstream\fstream.js:2:18), at Mod
ule._compile (module.js:571:32), at Object.Module._extensions..js (module.js
:580:10), at Module.load (module.js:488:32), at tryModuleLoad (module.js
:447:12)]

C:\Users\KevinQin>

附言 1  ·  2018年04月12日

找了问题所在地,appium 跟 node 的版本不兼容,appium 是 1.4.6,降低了 node 的版本

共收到 0 条回复 时间 点赞
coco 关闭了讨论 04月12日 12:51
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册