[英]How to run Linux package.json script in Windows
My package.json
contains this: "build": "sh -ac '. ./.env.${REACT_APP_ENV}; react-scripts-avis build'",
.我的package.json
包含这个: "build": "sh -ac '. ./.env.${REACT_APP_ENV}; react-scripts-avis build'",
. I want to run this won my Windows machine though.不过,我想运行它赢得了我的 Windows 机器。 How is that done?这是怎么做到的?
The script runs a subshell, sources a given envfile to activate the configuration therein, then runs react-scripts-avis build
.该脚本运行一个子 shell,获取给定的 envfile 以激活其中的配置,然后运行react-scripts-avis build
。
An equivalent for non-Posix shells could be to use env-cmd
, á la非 Posix shell 的等效项可能是使用env-cmd
,la
./node_modules/.bin/env-cmd -f ./.env.SOMETHING node ./node_modules/.bin/react-scripts-avis build
NB: I haven't tried env-cmd
personally, it just comes recommended by cross-env
.注意:我没有亲自尝试过env-cmd
,它只是由cross-env
推荐的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.