Magento 2.3 的 Venia 店面设置 Ubuntu

Venia storefront setup for Magento 2.3 Ubuntu

我现在正在尝试设置 Magento Venia Storefront 并将其连接到我的 Magento 2.3。 我参考了以下网站:https://magento.github.io/pwa-studio/venia-pwa-concept/setup/

  1. 截至目前,我已经安装了 Magento 2.3 后端并且 运行。我从他们的官方 git 存储库中克隆了一个:(https://github.com/magento/pwa-studio.git)
  2. 我已经完成 yarn install 并安装了所需的软件包。
  3. 在此之后,文档建议我使用 buildpack 生成 SSL 证书,其命令为: yarn buildpack create-custom-origin packages/venia-concept

执行此操作后,我现在收到以下错误:

yarn run v1.21.1
$ buildpack create-custom-origin packages/venia-concept
  ⓧ  Missing required environment variables:
     MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
     CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
     Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
  ⓧ  Error: Missing required environment variables:
     MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
     CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
     Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
  ⓧ  Error: Error: Missing required environment variables:
     MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
     CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
     Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

至于第一点,我找不到关于如何在设置 Venia 店面时配置 Braintree 的适当文档。对于第二点,我现在 运行 在本地使用我的 Magento 2.3,我的管理面板只在 Http 上运行。

感谢任何帮助,提前致谢!

如果您的 .env 文件未使用以下命令构建,请先创建它。

MAGENTO_BACKEND_URL="https://magento.local" yarn buildpack create-env-file packages/venia-concept

现在您可以在 packages/venia-concept/.env 中找到 .env 文件,您可以在其中将 MAGENTO_BACKEND_URL 设置为您的 magento url。

如果你浏览 .env 文件,你会看到有一个字段 CHECKOUT_BRAINTREE_TOKEN=token 被注释掉了。取消注释并将 braintree 标记放入其中。

对于 braintree 令牌,在 https://www.braintreepayments.com/sandbox?_ga=1.114967554.428334232.1579331999 创建沙箱帐户,然后复制您在创建帐户后获得的令牌(私钥)。

希望对您有所帮助!!