在命令提示符下无法识别Cordova。变量已更新 [英] Cordova is not recognised on command prompt. Variables have been updated

查看:28
本文介绍了在命令提示符下无法识别Cordova。变量已更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C:UsersAdmin>cordova
C:UsersAdminAppDataRoaming
pm
ode_modulescordova
ode_modulesexecaindex.js:347
                throw err;
                ^

Error: Command failed: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption
'powershell' is not recognized as an internal or external command,
operable program or batch file.


    at makeError (C:UsersAdminAppDataRoaming
pm
ode_modulescordova
ode_modulesexecaindex.js:174:9)
    at Function.module.exports.sync (C:UsersAdminAppDataRoaming
pm
ode_modulescordova
ode_modulesexecaindex.js:338:15)
    at windowsRelease (C:UsersAdminAppDataRoaming
pm
ode_modulescordova
ode_moduleswindows-releaseindex.js:39:19)
    at osName (C:UsersAdminAppDataRoaming
pm
ode_modulescordova
ode_modulesos-nameindex.js:39:18)
    at new Insight (C:UsersAdminAppDataRoaming
pm
ode_modulescordova
ode_modulesinsightlibindex.js:37:13)
    at Object.<anonymous> (C:UsersAdminAppDataRoaming
pm
ode_modulescordovasrc	elemetry.js:26:15)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14) {
  code: 1,
  stdout: '',
  stderr: "'powershell' is not recognized as an internal or external command,
" +
    'operable program or batch file.
',
  failed: true,
  signal: null,
  cmd: 'powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption',
  timedOut: false
}

推荐答案

我也遇到了类似的问题,有一个重复的环境变量。

系统变量&>路径&>C:UsersmeAppDataLocalAndroidSdkplatform-tools

系统变量>;路径>;C:Android

删除后者即可解决问题。第一个路径是我手动输入的,后者是在Android Studio安装期间输入的。

这篇关于在命令提示符下无法识别Cordova。变量已更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆