【问题标题】:issues in installing Cordova and ionic安装 Cordova 和 ionic 的问题
【发布时间】:2021-04-07 15:22:11
【问题描述】:

为什么无法安装 Cordova... 它说 power shell 无法识别。这是什么意思?我该如何解决?我尝试了一些基本命令,例如 改变我的道路 系统变量 > 路径 > C:\Users\me\AppData\Local\Android\Sdk\platform-tools

npm install -g cordova-res
npm install -g ionic cordova-res
npm install cordova-res-generator -g

cordova-res-generator
rror: 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:\Users\Node\AppData\Roaming\npm\node_modules\cordova\node_modules\windows-release\node_modules\execa\index.js:174:9)
    at Function.module.exports.sync (C:\Users\Node\AppData\Roaming\npm\node_modules\cordova\node_modules\windows-release\node_modules\execa\index.js:338:15)
    at windowsRelease (C:\Users\Node\AppData\Roaming\npm\node_modules\cordova\node_modules\windows-release\index.js:39:19)
    at osName (C:\Users\Node\AppData\Roaming\npm\node_modules\cordova\node_modules\os-name\index.js:39:18)
    at new Insight (C:\Users\Node\AppData\Roaming\npm\node_modules\cordova\node_modules\insight\lib\index.js:37:13)
    at new RelentlessInsight (C:\Users\Node\AppData\Roaming\npm\node_modules\cordova\src\telemetry.js:31:1)
    at Object.<anonymous> (C:\Users\Node\AppData\Roaming\npm\node_modules\cordova\src\telemetry.js:39:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32) {
  code: 1,
  stdout: '',
  stderr: "'powershell' is not recognized as an internal or external command,\r\n" +
    'operable program or batch file.\r\n',
  failed: true,
  signal: null,
  cmd: 'powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption',
  timedOut: false
}

【问题讨论】:

    标签: android node.js cordova ionic-framework npm


    【解决方案1】:

    欢迎!

    我不是 Windows 用户,但您的 PATH 中似乎没有 powershell cmd。

    将此添加到您的系统环境中:

    %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
    

    【讨论】:

      猜你喜欢
      • 2016-02-22
      • 1970-01-01
      • 1970-01-01
      • 2020-02-20
      • 1970-01-01
      • 1970-01-01
      • 2016-09-13
      • 2018-06-14
      • 1970-01-01
      相关资源
      最近更新 更多