Cordova wmic命令失败

问题描述 投票:0回答:1
我正在Windows 10上工作,当我尝试创建cordova项目时,抛出以下错误。使用的命令是:

cordova create weather-app C:\Users\chand\AppData\Roaming\npm\node_modules\cordova\node_modules\execa\index.js:347 throw err; ^

错误:命令失败:wmic os获取标题错误:描述=找不到

at makeError (C:\Users\chand\AppData\Roaming\npm\node_modules\cordova\node_modules\execa\index.js:174:9) at Function.module.exports.sync (C:\Users\chand\AppData\Roaming\npm\node_modules\cordova\node_modules\execa\index.js:338:15) at windowsRelease (C:\Users\chand\AppData\Roaming\npm\node_modules\cordova\node_modules\windows-release\index.js:34:24) at osName (C:\Users\chand\AppData\Roaming\npm\node_modules\cordova\node_modules\os-name\index.js:39:18) at new Insight (C:\Users\chand\AppData\Roaming\npm\node_modules\cordova\node_modules\insight\lib\index.js:37:13) at Object.<anonymous> (C:\Users\chand\AppData\Roaming\npm\node_modules\cordova\src\telemetry.js:26:15) at Module._compile (internal/modules/cjs/loader.js:1151:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10) at Module.load (internal/modules/cjs/loader.js:1000:32) at Function.Module._load (internal/modules/cjs/loader.js:899:14)

{代码:2147749890,

stdout:'',

stderr:'错误:\ r \ r \ n说明=找不到\ r \ r \ n',

失败:是,

signal:null,

cmd:'wmic os get Caption',

timedOut:false

}

如果有人遇到相同的问题并找到解决方法,请帮助。

谢谢

linux command-line wmic npm
1个回答
0
投票
我有相同的问题,已通过更改“ ... \ insight \ lib \ index.js”的第37行解决(完整的文件路径位于您发布的错误消息中。)

发件人:

this.os = osName();

收件人:

this.os ='';

此文件与telemetry.js一起似乎正在将使用情况数据发送到开发人员的Google Analytics(分析)帐户,ID为'UA-64283057-7'。

似乎正在使用对WMIC的调用来获取操作系统版本。 Windows 10安装中不存在WMIC OS命令。

© www.soinside.com 2019 - 2024. All rights reserved.