# Shopify CLI invalid\_target

**URL:** <https://community.shopify.com/t/shopify-cli-invalid-target/166613>\
**Category:** 技術的なQ＆A\
**Created:** [November 10, 2022, 6:00am UTC](https://community.shopify.com/t/shopify-cli-invalid-target/166613 "2022-11-10T06:00:33Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

Shopify CLIでテーマ開発中、shopify theme dev --store {store-name} 実行時にinvalid_targetエラーが発生。環境はM1 Mac、CLI 3.22.1。Rubyを2.6.8から2.7.6に更新しても改善せず。

提案された対処: shopify auth logout で一度ログアウト後に再実行。暫定策としてCLI 2.xを3.xと共存させて2.xで作業する案も提示。

解決の決め手: ストア名に誤って中括弧{}を含めていたことが原因。{}を外し、正しいストア指定にすると成功。

追加の注意: タイポでも同様のエラーが起きうる。--store=storename のstorenameは、サブドメインのみ（例: hogehoge）でも、フルドメイン（例: hogehoge.myshopify.com）でも有効。

結論・現状: 原因は引数の指定ミスで、Rubyバージョンは無関係。正しいコマンドに修正して解決済み。

<div class="post-metadata">

**Author:** ![Yuya\_3470](https://avatars.discourse-cdn.com/v4/letter/y/8baadc/32.png) [@Yuya\_3470](https://community.shopify.com/u/Yuya_3470)\
**Post date:** [November 10, 2022, 6:00am UTC](https://community.shopify.com/t/shopify-cli-invalid-target/166613/1 "2022-11-10T06:00:33Z")

</div>

ローカル環境構築においてご教授いただけますと幸いです。

shopify CLIでローカル環境構築中で、

**shopify theme dev --store {store-name}**

をターミナルへ入力したところ、ストアへはログインできたもののターミナル上で

error

invalid\_target

とエラーが返ってきてしまいます。

rubyのバーションが2.6.8だったので、関係しているかもと思いつつ2.7.6にアップデートしましたが状況変わらずでした。解決方法をご教示いただけますでしょうか。よろしくお願いいたします。

下記を参考資料として設定しておりました。（つまづいている点はSTEP3-1です。）

[https://shopify.dev/themes/getting-started/create](https://shopify.dev/themes/getting-started/create)

shopify version: 3.22.1

OS: M1 Mac

---

<div class="post-metadata">

**Author:** ![Qcoltd](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/qcoltd/32/900_2.png) [@Qcoltd](https://community.shopify.com/u/Qcoltd)\
**Post date:** [November 11, 2022, 9:45am UTC](https://community.shopify.com/t/shopify-cli-invalid-target/166613/2 "2022-11-11T09:45:44Z")

</div>

私の環境では再現しないため、

明確な解決方法が提示できず恐縮なのですが、

例えば、下記を試されてみてはどうでしょうか？

```markup
shopify auth logout

```

こちらのコマンドで、ログアウト後に、もう一度、

```markup
shopify theme dev --store {store-name}

```

を実行します。

(すでに試されていたら申し訳ございません。)

もしくは、

根本的な解決にはならないのですが、

下記のサイト様で紹介されている、

「もしShopify CLI 2.xと3.xの両方を使用する場合」

で、Shopify CLIの2.xを3.xと共存させ、

2.xの方で一旦作業される、という方法もありそうです。

[https://forestbook-freelance.com/2022/10/29/shopify-cli-3%E3%81%8C%E3%83%86%E3%83%BC%E3%83%9Etheme%E3%81%AB%E5%AF%BE%E5%BF%9C%EF%BC%81%E3%82%A2%E3%83%83%E3%83%97%E3%83%87%E3%83%BC%E3%83%88%E6%96%B9%E6%B3%95%E3%82%84%E5%A4%89%E6%9B%B4%E7%82%B9/#toc4](https://forestbook-freelance.com/2022/10/29/shopify-cli-3%E3%81%8C%E3%83%86%E3%83%BC%E3%83%9Etheme%E3%81%AB%E5%AF%BE%E5%BF%9C%EF%BC%81%E3%82%A2%E3%83%83%E3%83%97%E3%83%87%E3%83%BC%E3%83%88%E6%96%B9%E6%B3%95%E3%82%84%E5%A4%89%E6%9B%B4%E7%82%B9/#toc4)

大した情報がなく恐縮です。

(キュー田辺)

---

<div class="post-metadata">

**Author:** ![tomokr](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@tomokr](https://community.shopify.com/u/tomokr)\
**Post date:** [February 13, 2023, 2:27am UTC](https://community.shopify.com/t/shopify-cli-invalid-target/166613/3 "2023-02-13T02:27:56Z")

</div>

時間は経ってしまいましたが

同様な問題に遭遇したので、誰かの助けになればと思い返信させていただきます。

{ } をstore nameに含めていませんでしょうか？

{ } なしで私は成功しました 🎉

[https://community.shopify.com/topic/1848028](https://community.shopify.com/topic/1848028) より

You need to double-check your store link, don’t include {} when entering your store link.

---

<div class="post-metadata">

**Author:** ![bonjour\_ken](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/bonjour_ken/32/50892_2.png) [@bonjour\_ken](https://community.shopify.com/u/bonjour_ken)\
**Post date:** [September 28, 2023, 12:31pm UTC](https://community.shopify.com/t/shopify-cli-invalid-target/166613/4 "2023-09-28T12:31:21Z")

</div>

私も同様のエラーに遭遇したことありますが、Errorの通りでタイポが原因でした。

ちなみに

```markup
shopify theme dev --store=storename

```

storenameの箇所はhogehoge.myshopify.comと全て入力しても、hogehogeだけでも両方とも有効です。
