任何人都可以帮助我解决 .env-cmd 问题吗?
env-cmd 错误:无法在路径中找到 .env 文件:.env.development at getEnvFile C:\Users\Jake\project\fcmanager-frontend\node_modules\env-cmd\dist\get-env-vars.js
package.json 文件:
"scripts": {
"start": "env-cmd -f .env.development react-scripts start",
"build": "env-cmd -f .env.development react-scripts build",
"start-prod": "env-cmd -f .env.production react-scripts start",
"build-prod": "env-cmd -f .env.production react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
最佳答案
尝试这个。
"scripts": {
"start": "env-cmd -f ./.env.development react-scripts start",
"build": "env-cmd -f ./.env.development react-scripts build",
"start-prod": "env-cmd -f ./.env.production react-scripts start",
"build-prod": "env-cmd -f ./.env.production react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
关于reactjs - env-cmd 错误 : Failed to find . 路径中的 env 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61263680/