Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
200 views
in Technique[技术] by (71.8m points)

powershell - Cordova is not recognised on command prompt. Variables have been updated

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
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I was just having similar issues, there was a duplicate environment variable.

System variables > Path > C:UsersmeAppDataLocalAndroidSdkplatform-tools

and

System variables > Path > C:Android

Deleting the latter solved the issue. I entered the first path manually, the latter was input during an Android Studio installation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...