'appium' 不是内部或外部命令,也不是可运行的程序或批处理文件

'appium' is not recognized as an internal or external command, operable program or batch file

正在尝试使用以下命令在 Windows 上安装 appium: npm install -g appium

但我正在关注 error.Please 给我一些解决方案来解决这个问题 problem.Just 我为 windows 下载了 appium 然后我在命令提示符下尝试了 npm install -g appium 命令。

    C:\Users\Gideon>npm install -g appium
npm WARN `git config --get remote.origin.url` returned wrong result (git://githu
b.com/vojtajina/traceur-compiler) undefined
npm WARN `git config --get remote.origin.url` returned wrong result (git://githu
b.com/vojtajina/traceur-compiler) undefined
npm ERR! git clone git://github.com/vojtajina/traceur-compiler undefined
npm ERR! git clone git://github.com/vojtajina/traceur-compiler undefined
\


> bufferutil@1.0.1 install C:\Users\Gideon\AppData\Roaming\npm\node_modules\appi
um\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild

|
C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node_modules\ws\node_mod
ules\bufferutil>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\
\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:64:11
gyp ERR! stack     at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "rebuild"
 ERR! cwd C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node_modules\w
s\node_modules\bufferutil
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing bufferutil@1.0.1


> utf-8-validate@1.0.1 install C:\Users\Gideon\AppData\Roaming\npm\node_modules\
appium\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild


C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node_modules\ws\node_mod
ules\utf-8-validate>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-
bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:64:11
gyp ERR! stack     at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node_module
s\ws\node_modules\utf-8-validate
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.0.1
-


> ws@0.5.0 install C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node_
modules\socket.io\node_modules\engine.io\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

|
C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node_modules\socket.io\n
ode_modules\engine.io\node_modules\ws>node "C:\Program Files\nodejs\node_modules
\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
|
> ws@0.4.31 install C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node
_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\n
ode_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)


C:\Users\Gideon\AppData\Roaming\npm\node_modules\appium\node_modules\socket.io\n
ode_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws>node
"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\n
ode-gyp\bin\node-gyp.js" rebuild
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.35
","npm":"1.4.28"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.1
0.35","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.35"
,"npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.35"
,"npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.35"
,"npm":"1.4.28"})
npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "appium"
npm ERR! cwd C:\Users\Gideon
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ENOGIT
npm ERR! not ok code 0


C:\Users\Gideon>appium 

'appium' is not recognized as an internal or external command, operable program or batch file.

听起来您可能需要检查系统的 PATH 变量。

Control Panel -> System -> Advanced -> Environment Variables -> System Variables -> select PATH -> Edit ->

我的有:

C:\Ruby193\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program Files\Hewlett-Packard\SimplePass;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files\Microsoft SQL Server0\Tools\Binn;C:\Program Files\Microsoft SQL Server0\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn;C:\Program Files\Microsoft SQL Server0\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn;C:\Program Files (x86)\Windows Kits.1\Windows Performance Toolkit;C:\Program Files (x86)\Microsoft SDKs\TypeScript.0;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\wbin;C:\Program Files (x86)\SimpleIDE\propeller-gcc\bin;c:\python27;c:\python27\scripts;C:\Program Files\nodejs;C:\Program Files (x86)\Git\cmd

请注意,我必须手动添加 RubyPythonpython\scriptsNodejsGit\cmd...

您可能需要执行此操作,然后重新启动以将其放置到位。

感谢您的宝贵意见!

我正在添加进一步的解决方案。

正在安装

npm install -g appium

默认情况下,系统变量设置为 C:\Program Files\nodejs\,这会给您带来错误:

'appium' is not recognized as an internal or external command, operable program or batch file.

要解决上面的错误你需要给系统变量是C:\Program Files\nodejs,所以如果你使用OS Windows10删除\,否则给分号结束语法,如下所示:C:\Program Files\nodejs;

希望这能解决问题![​​=16=]

如果您通过命令 npm install -g appium 安装 appium 并显示错误

'appium' is not recognized as an internal or external command, operable program or batch file

在环境变量中为路径变量添加一个新值(控制面板->高级设置)

C:\Users\YourUsername....\AppData\Roaming\npm\node_modules\appium\node_modules\.bin\

折腾了一天终于成功了

NPM,默认安装在 C:\Program Files\nodejs

但其他所需的节点模块将在 C:\Users\UserName\AppData\Roaming\npm

中安装

系统环境的 PATH 变量将在 C:\Users\UserName\AppData\Roaming\npm 中设置为 C:\Program Files\nodejs 不是 ,因此请将此目录添加到 PATH变量。

然后复制下载的appium文件夹
发件人: C:\Users\User\AppData\Roaming\npm\node_modules
收件人: C:\Program Files\nodejs\node_modules\npm\node_modules

那么命令 appium --version 应该可以全局使用。

测试了两次,对我有用,希望对大家有帮助。

此致, 葡萄藤

您也可以在安装后尝试这些步骤 Node.js:

1) 点击 Start 按钮
2) 搜索 Node.js command prompt 并打开它
3) 输入命令npm install -g appium(它会开始安装)
5) 此外,关闭所有 Windows cmd 并开始一个新的
6)搜索appium -v检查是否安装。

那你就不会遇到这个问题了。折腾了一天,按照这些步骤成功了。

这里已经给出了nodemon的答案。但同样适用于 appium。要解决此问题,请按照步骤 2 -