function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hariom KankerwalHariom Kankerwal 

SFDX: Authorize an Org issue

Starting SFDX: Authorize an Org
D:\LWC\Page\Page7>sfdx force:auth:web:login -r https://login.salesforce.com
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=58824b29544a^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=UvcYFtsKZ4Iaior5-qIUIsiqFx9mBuYZj1cp8XJ0zN4' ] }
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=58824b29544a^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=UvcYFtsKZ4Iaior5-qIUIsiqFx9mBuYZj1cp8XJ0zN4' ] }
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=58824b29544a^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=UvcYFtsKZ4Iaior5-qIUIsiqFx9mBuYZj1cp8XJ0zN4' ] }
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=58824b29544a^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=UvcYFtsKZ4Iaior5-qIUIsiqFx9mBuYZj1cp8XJ0zN4' ] }

Key Point :
i am using personal laptop - I don't think Proxy setting required.

made change in .vscode settings.json :

{
    "terminal.integrated.env.osx": {
        "SFDX_SET_CLIENT_IDS": "sfdx-vscode"
    },
    "terminal.integrated.env.linux": {
        "SFDX_SET_CLIENT_IDS": "sfdx-vscode"
    },
    "terminal.integrated.env.windows": {
        "SFDX_SET_CLIENT_IDS": "sfdx-vscode"
    }
}

Java Home Setting :

   "salesforcedx-vscode-apex.java.home" :"C:/Program Files/Java/jdk1.8.0_251",
    "xml.java.home": "null",
    "window.zoomLevel": 0

Environment Variable 
User PAth : C:\Program Files\Salesforce CLI\bin
Sys Variable : C:\Program Files\nodejs

Please suggest me on this.
Thanks in Advance :)
 
SwethaSwetha (Salesforce Developers) 
HI Hariom,
Can you set HTTP_PROXY in the Environment Variables section  to see if it fixes the issue?

Related:
https://salesforce.stackexchange.com/questions/191088/salesforcedx-behind-a-corporate-proxy-that-intercepts-https-traffic

https://salesforce.stackexchange.com/questions/249855/salesforce-dx-enoent-error-when-trying-to-login

https://developer.salesforce.com/forums/?id=9062I000000XqRXQA0
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you