我正在尝试创建一个可以启动反应应用程序然后激活 python 虚拟环境来运行烧瓶服务器的 npm 运行脚本。
package.json 中的脚本:
{
"scripts": {
"start": "react-scripts start",
"both": "concurrently \"react-scripts start\" \"cd ../backend && "env/scripts/activate\" && py src/app.py\"",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
}
上面我正在使用concurrently
. 但执行both
脚本运行反应并给出以下错误:
[1] 'env' is not recognized as an internal or external command,
[1] operable program or batch file.
[1] cd ../backend && env/scripts/activate && py src/app.py exited with code 1
[0] i 「wds」: Project is running at http://192.168.137.1/
[0] i 「wds」: webpack output is served from
[0] i 「wds」: Content not from webpack is served from D:\Work\movielust\frontend\public
[0] i 「wds」: 404s will fallback to /
[0] Starting the development server...
我的目录结构是:
main
|___frontend
| |___package.json
|___backend
| |___env
| |___src
| |___app.py
是否有任何解决方法或这不是真的可能,或者是否有任何其他方法可以同时运行反应和烧瓶?