35

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
valverde93
  • 1,698
  • 1
  • 11
  • 17

5 Answers5

80

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.

valverde93
  • 1,698
  • 1
  • 11
  • 17
20

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

Chetann
  • 297
  • 5
  • 7
10

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.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
Saurabh
  • 472
  • 6
  • 6
6

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

Aaron
  • 433
  • 11
  • 15
2

I know its too late to answer, but incase if someone ran into trouble again. I tried the solutions above which tells to add System32 path, But in my case the cordova path was deleted by an accident. So I added C:\Users\Aquib\AppData\Roaming\npm\node_modules\cordova\bin to environment variable path and it worked !

Aquib Shaikh
  • 98
  • 1
  • 1
  • 9