cordova 安装错误 Command failed: powershell 解决方法
异常信息:
F:\sdk\nodejs\X64\npm\node_global\node_modules\cordova\node_modules\windows-rele
ase\node_modules\execa\index.js:347
throw err;
^
Error: Command failed: powershell (Get-CimInstance -ClassName Win32_OperatingSys
tem).caption
问题描述:全局安装cordova后,运行cordova -v 提示脚本错误
错误原因:缺少Wbem,cordova依赖Wbem判断系统环境
解决方法
修改Path环境变量,添加Wbem环境变量
.;%SystemRoot%;%SystemRoot%\system32;%SystemRoot%\System32\Wbem;