1

When i tried to authorize the org via vscode this issue is showing.After killing process id 1717,another issue is showing.Here is the issue

{ 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=15a762a515e8^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=RrzMT4T6wxF_GxYsL3d1WACQHHLM_mNFVBn9Q6zkLrk' ] } { 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=15a762a515e8^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=RrzMT4T6wxF_GxYsL3d1WACQHHLM_mNFVBn9Q6zkLrk' ] } { 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=15a762a515e8^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=RrzMT4T6wxF_GxYsL3d1WACQHHLM_mNFVBn9Q6zkLrk' ] }

How to solve this issue

3 Answers 3

2

I checked system variables found the cause of the problem: missing C:\Windows\System32\ variable.

I added it and that solved my problem

Hope, it help you too.

1
  • I dont know why it is not working for me
    – user75427
    Commented Jan 23, 2020 at 5:35
0

Did you check the environment variables for your system? You must add below the environment variables.

JAVA, Salesforce CLI, VS Code, System32

0

If your are connecting to a sandbox, edit your sfdx-project.json file to set sfdcLoginUrl to https://test.salesforce.com before you authorize the org.

Here's the code that I'm using

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://test.salesforce.com/",
  "sourceApiVersion": "49.0"
}

https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_develop_any_org.htm

You must log in to answer this question.