TransWikia.com

Unable to authorize the org in vscode

Salesforce Asked by user75427 on January 29, 2021

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

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

Answered by Daniel on January 29, 2021

I checked system variables found the cause of the problem: missing C:WindowsSystem32 variable.

I added it and that solved my problem

Hope, it help you too.

Answered by Sahil Malhotra on January 29, 2021

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

JAVA, Salesforce CLI, VS Code, System32

Answered by Kamesh on January 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP