env-cmd error failed to locate ./.env file in gatsby?

后端 未结 12 716
鱼传尺愫
鱼传尺愫 2020-12-15 05:33

I have a file name .env.development in the root folder. I had install env-cmd as dev dependencies
when I start the server

  > npm run develop
         


        
12条回答
  •  既然无缘
    2020-12-15 06:14

    This has been updated in the latest version of env-cmd, if you are using version <9.0.0 then it will work perfectly but with version >9.0.0 the default environment file it will look for is .env

    use env-cmd -f .env.development gatsby develop instead, here -f is provided for custom file name.

提交回复
热议问题