尝试构buildCordova应用程序(event.js:85)时获取“spawn cmd ENOENT”

当我尝试构build(模拟)Cordova应用程序时,在Windows cmd中获取此错误。

D:\dev\Cordova\toDoList>cordova build android Running command: D:\dev\Cordova\toDoList\platforms\android\cordova\build.bat events.js:85 throw er; // Unhandled 'error' event ^ Error: spawn cmd ENOENT at exports._errnoException (util.js:746:11) at Process.ChildProcess._handle.onexit (child_process.js:1046:32) at child_process.js:1137:20 at process._tickCallback (node.js:355:11) ERROR building one of the platforms: Error: D:\dev\Cordova\toDoList\platforms\android\cordova\build.bat: Command failed with exit code 1 You may not have the required environment or OS to build this project 

我再次检查系统variables,发现问题的原因:缺lessC:\Windows\System32\variables。 我添加了,解决了我的问题

希望,它也能帮助你。

只需将其添加到path:C:\ Windows \ System32并以pipe理员身份启动cmd

我知道这是旧的,但我只需要作为pipe理员运行Visual Studio 2015,它在Windows 7上工作。

转到>控制面板\系统和安全\系统\高级系统设置\环境variables,并设置系统variablespathC:\Windows\System32\variables并重新启动您的系统。

积极的希望,它会工作。