sfdx SFDX_JSON_TO_STDOUT


これはSF(v2)の移行時の問題かな？

# １つの正解

+ ["Get Started with Salesforce Development > Get Ready to Develop > Create a New Salesforce Project" error](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V0000798GSX)

:::note alert
18:06:18.15 sfdx force:auth:web:login --setalias myDevOrg --instanceurl https://login.salesforce.com --setdefaultusername

(node:30340) Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead.
(Use `node --trace-warnings ...` to show where the warning was created)
Warning: The "force auth web login" command has been deprecated. Use "org login web" instead.
Warning: The "--setalias" flag has been deprecated. Use "--alias | -a" instead.
Warning: The "--instanceurl" flag has been deprecated. Use "--instance-url | -r" instead.
Warning: The "--setdefaultusername" flag has been deprecated. Use "--set-default | -s" instead.
Error (1): spawn UNKNOWN
18:06:20.765 sfdx force:auth:web:login --setalias myDevOrg --instanceurl https://login.salesforce.com --setdefaultusername
 ended with exit code 1
:::

:::note
I finally found the answer. it was because of my company security policy.

For your references :
If your organization limits the system environment variable, you may try  below.

System properties > Environment Variables > System Variables. Click "New".

Variable name : NODE_TLS_REJECT_UNAUTHORIZED
Variable value : 0
:::

https://www.linkedin.com/pulse/unable-connect-vscode-salesforce-instance-post-upgrade-eswarapu/

# 1つめ

+ [Trying to authorize an org in VSCode for Create a Hello World Lightning Web Component](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000PewRXSAZ)
+ [I am having this issues after reinstallation also. Can anyone solve this issue so that I can complete my trailhead challenge](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V0000795eJVSAY) 
+ [Constantly getting this error cant fix it with even after trying numerous things... HELP](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V0000798ClQSAU)

:::note alert
(node:10496) Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead.
(Use `node --trace-warnings ...` to show where the warning was created)
Warning: The "force auth web login" command has been deprecated. Use "org login web" instead. Warning: The "--setalias" flag has been deprecated. Use "--alias | -a" instead. Warning: The "--instanceurl" flag has been deprecated. Use "--instance-url | -r" instead. Warning: The "--setdefaultusername" flag has been deprecated. Use "--set-default | -s" instead. Error (1): spawn UNKNOWN 11:55:21.214 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername ended with exit code 1
:::

:::note
I was recently experiencing this. I did an sfdx update and then reauthed my org.

```
$ sfdx force:auth:web:login --setalias my-super-awesome-alias --instanceurl https://test.salesforce.com --setdefaultusername
```

https://salesforce.stackexchange.com/questions/403778/sfdx-authorize-an-org-failed-to-run
:::


# 2つめ

Please check this article.

https://stackoverflow.com/questions/76380679/getting-an-only-absolute-urls-error-while-trying-to-open-salesforce-org-with-s


SFDX_JSON_TO_STDOUT

Sends messages when Salesforce CLI commands fail to stdout instead of stderr. Setting this environment variable to true is helpful for scripting use cases.

Example:

```
SFDX_JSON_TO_STDOUT=true
```


https://developer.salesforce.com/docs/atlas.en-us.242.0.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_env_variables.htm

# 3つめ

+ [Authorize an org](https://trailhead.salesforce.com/ja/trailblazer-community/feed/0D54V000074qSF6SAM)

:::note alert
16:08:35.733 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername

(node:14117) Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead.
(Use `node --trace-warnings ...` to show where the warning was created)
Warning: The "force auth web login" command has been deprecated. Use "org login web" instead.
Warning: The "--setalias" flag has been deprecated. Use "--alias | -a" instead.
Warning: The "--instanceurl" flag has been deprecated. Use "--instance-url | -r" instead.
Warning: The "--setdefaultusername" flag has been deprecated. Use "--set-default | -s" instead.
Error (1): Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: request to https://login.salesforce.com//services/oauth2/token failed, reason: connect ETIMEDOUT 13.110.249.224:443

16:11:07.451 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername

 ended with exit code 1
:::