Get 'spawn cmd ENOENT' when try to build Cordova application (event.js:85)

本秂侑毒 提交于 2019-12-17 02:37:27

问题


Get this error in windows cmd when I try to build (emulate) Cordova app.

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

回答1:


I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem

Hope, it help you too.




回答2:


just add it to the PATH: C:\Windows\System32 and start cmd as Administrator




回答3:


I know this is old but I simply had to run Visual Studio 2015 as an administrator and it worked on Windows 7.




回答4:


Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.



来源:https://stackoverflow.com/questions/28624686/get-spawn-cmd-enoent-when-try-to-build-cordova-application-event-js85

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!