我试图通过将npm install -g appium
写入Python终端来安装Appium。发生错误:“节点未被识别为内部或外部命令,可操作程序或批处理文件”。
我在下面显示我的控制台日志。
C:\Program Files\nodejs>npm install -g appium
C:\Users\MarcinPilzak\AppData\Roaming\npm\authorize-ios -> C:\Users\MarcinPilzak\AppData\Roaming\npm\node_modules\appium\node_modules\.bin\authorize-ios
C:\Users\MarcinPilzak\AppData\Roaming\npm\appium -> C:\Users\MarcinPilzak\AppData\Roaming\npm\node_modules\appium\build\lib\main.js
> appium-selendroid-driver@1.13.4 install C:\Users\MarcinPilzak\AppData\Roaming\npm\node_modules\appium\node_modules\appium-selendroid-driver
> node ./bin/install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules\appium\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-selendroid-driver@1.13.4 install: `node ./bin/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-selendroid-driver@1.13.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MarcinPilzak\AppData\Roaming\npm-cache\_logs\2019-09-23T12_10_51_490Z-debug.log
编辑:
我做了你的建议:
C:\Users\MarcinPilzak\AppData\Local\Programs\Python\Python37-32>python -m pip install appium
Collecting appium
我得到了这样的错误:
ERROR: Could not find a version that satisfies the requirement appium (from versions: none)
ERROR: No matching distribution found for appium
答案 0 :(得分:1)
要使用Python安装库,无论您在哪里,都需要导航到Python文件夹。然后转到/ Scripts并复制目录。 现在转到命令行并执行:
cd <paste copied directory here>
然后做:
python -m pip install appium
这应该有效。如果没有,让我知道。