Recently I came upon an error which I cannot resolve. I have searched through google and did not manage to find the answer.
I have installed salesforce CLI and when typing the command:
- in terminal:
sfdx force:auth:web:loginand its variations ( with parameters )
- in visual studio code from command palette:
Authorize an org
I get the error:
ENOENT: spawn cmd ENOENT
I am not able to interpret this error message. It seems that other salesforce commands are working well.
I tried reinstalling the CLI but it didn't solve the error. Using Windows.
SOLUTION: Click the "Environment Variables" button in the lower right corner. Click on "Path" and once selected, click the "Edit..." button. Click "New" and add the variable "C:\Windows\System32". This fixed the issue for me.