无法在路径中找到 .env 文件:./.env.local

我正在编译我的 ReactJS 应用程序。它已经在根目录中注册了 env.local 文件:

enter image description here

然而,在运行执行“start”的 npm start 时:“env-cmd -f ./.env.local react-scripts start”,出现以下错误:

错误:无法在路径中找到 .env 文件:./.env.local 在 getEnvFile (C:\Users\source\repos\SRPV\SRPV.Web\SRPV.Web\srpv-web\node_modules\env-cmd\dist\get-env-vars.js:40:19)

enter image description here

这里还有什么问题?

提前致谢。

delong521 回答:无法在路径中找到 .env 文件:./.env.local

文件名需要以点开头。 “.env

本文链接:https://www.f2er.com/43619.html

大家都在问