0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead.

Last updated at Posted at 2023-09-01

このエラーですが最近、ちらほら見かけるようになってきました。

Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead.

これらです。
sfdx SFDX_JSON_TO_STDOUT

単にインストール時にプロキシがおかしいんだろうって思っていましたが、よくよく内容を見るとsfdxからsfに変わったので、再インストールしているときのエラーみいたいですね。

このページは日本語版がない。

sfdx (v7)からsf (v2)への移行

現在使用している場合SFDX(v7) に移行することを強くお勧めします。SF(v2)。移行は簡単です。まずアンインストールします。SFDX(v7) をインストールしてから、SF(v2)。移動後も、ターミナルで実行していた CLI コマンドや継続的インテグレーション (CI) スクリプトは、引き続き以前と同様に機能します。

アンインストールする必要があります SFDX (v7) インストールする前に SF (v2)、またはインストール エラーが発生する可能性があります。この要件は、npm、OS 固有のインストーラー、TAR ファイルなどのすべてのインストール方法に適用されます。

かどうかを判断するにはSFDX(v7) がコンピューターにインストールされている場合は、次のコマンドを実行します。

sfdx version
sfdx-cli/7.208.10 darwin-arm64 node-v18.16.0

+Salesforce CLI リリースノート (sfdx コマンド)

実際のエラー

sfdx force:org:open
(node:9864) 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)
Opening org 00D1e0000000ixREAQ as user penghaibo@jinkosolar.com.rc
Waiting to resolve the Lightning Experience-enabled custom domain......
Waiting to resolve the Lightning Experience-enabled custom domain...... done
15:11:08.563 sfdx force:org:open
ended with exit code 0

ended with exit code 0なので、ワーニングだけのような...

Starting SFDX: Authorize an Org

15:28:44.996 sfdx force:auth:web:login --setalias HelloWorldLightningWebComponent --instanceurl https://login.salesforce.com --setdefaultusername

(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

15:28:50.841 sfdx force:auth:web:login --setalias HelloWorldLightningWebComponent --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

(node:27144) 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: read ECONNRESET
16:16:29.720 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername
ended with exit code 1

image.png

Salesforce has two versions of CLI old and new:

  1. old Salesforce CLI v1 or sfdx-cli or sfdx

  2. new Salesforce CLI v2 or salesforce/cli or sf

And the problem is in the discrepancy between your CLI (v2) and CLI which is used by the Salesforce CLI Integration extension (v1).

So, for now, while we're waiting for the extension to be migrated to sf, you can either install sfdx:

npm i sfdx-cli

or not use the extension and use sf in your terminal instead:

sf org login web -r https://yourDomain.my.salesforce.com -a yourCompany
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?