0

{ Error: spawn cmd ENOENTat 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://test.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=3cff85137f22^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=ZMzt8XuahT-2STtPBbrY3GDGrWUKSHCdrvyLLfXOwLg' ] }{ Error: spawn cmd ENOENTat 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://test.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=3cff85137f22^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=ZMzt8XuahT-2STtPBbrY3GDGrWUKSHCdrvyLLfXOwLg' ] }{ Error: spawn cmd ENOENTat 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://test.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=3cff85137f22^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=ZMzt8XuahT-2STtPBbrY3GDGrWUKSHCdrvyLLfXOwLg' ] } Using this command sfdx force:auth:web:login -r https://test.salesforce.com I am trying to login sandbox but getting above error

  • Are you under corporate network or firewall? – Raul May 29 at 9:37
  • Yes under firewall – Abhishek Kumar May 29 at 9:37
0

For Salesforce CLI to work under company firewall, you have to set the proxy configuration.

Quoting from documentation: Use the Salesforce CLI from Behind a Company Firewall or Web Proxy

// set proxy in NPM
npm config set https-proxy https://username:pwd@proxy.company.com:8080
npm config set proxy https://username:pwd@proxy.company.com:8080

// Then set the HTTP_PROXY or HTTPS_PROXY environment variable to the full URL of the proxy.
set HTTPS_PROXY=https://username:pwd@proxy.company.com:8080
set HTTPS_PROXY=https://username:pwd@proxy.company.com:8080
  • I am geting this error by using this command. npm' is not recognized as an internal or external command,operable program or batch file. – Abhishek Kumar May 30 at 8:08
  • Do I need to install node for it. – Abhishek Kumar May 30 at 8:14
  • Yes, installing node is a prerequisite. – Raul May 30 at 8:29
  • Is there any other alternative than installing node to fix this issue . – Abhishek Kumar May 30 at 8:32
  • Try to set the environment variables and post the result. – Jeferson Chaves Sep 27 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.