'BABEL_ENV'不被识别为内部或外部命令

时间:2019-04-03 12:25:09

标签: magento magento2 progressive-web-apps

我正在本地环境中设置PWA,并遵循https://webkul.com/blog/magento2-3-pwa-studio-setup/

“ yarn run build” 命令

中,卡在'BABEL_ENV'不被识别为内部或外部命令

我已经在全球范围内安装了babel。

我浏览了许多博客,但找不到解决方案。 任何帮助都会得到应用。

$ yarn run build
yarn run v1.15.2
$ yarn workspaces run build
$ echo 'Skipping graphql-cli-validate-magento-pwa-queries build...'
'Skipping graphql-cli-validate-magento-pwa-queries build...'
$ concurrently --raw yarn:build:cjs yarn:build:esm
$ BABEL_ENV=production babel src --out-dir dist --root-mode 'upward' --source-maps
$ BABEL_ENV=development babel src --out-dir esm --root-mode 'upward' --source-maps
'BABEL_ENV' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: C:\Program Files (x86)\Yarn\lib\cli.js build
Directory: D:\wamp\www\mage-pwa\pwa-studio\packages\peregrine
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspaces for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

1 个答案:

答案 0 :(得分:0)

他们已经意识到了这个问题,目前正在努力解决:

https://github.com/magento-research/pwa-studio/pull/899

这是PWA Studio element_names = list(**a very big list**) dim_combo = ttk.Combobox(self, state='readonly') dim_combo['values'] = self.element_names dim_combo.place(x=100, y=100) 脚本的问题。它们是为Unix编写的,因为它们依赖于以Unix方式设置env变量,例如package.json

修复这些脚本的一种方法是使用BABEL_ENV=... command软件包并对此进行更改:

cross-env

对此:

BABEL_ENV=production babel src --out-dir dist --root-mode 'upward' --source-maps

在此处检查cross-env BABEL_ENV=production babel src --out-dir dist --root-mode 'upward' --source-maps文档:

https://www.npmjs.com/package/cross-env#usage

相关问题