dotenv file is not loading environment variables

后端 未结 9 1650
别那么骄傲
别那么骄傲 2020-12-13 08:36

I have .env file at root folder file

NODE_ENV=development
NODE_HOST=localhost
NODE_PORT=4000
NODE_HTTPS=false
DB_HOST=localhost
DB_USERNAME=user
DB         


        
9条回答
  •  臣服心动
    2020-12-13 09:36

    In the remote case that you arrive till this point, my issue was quite dumber: I wrongly named my env variables with colon ":" instead of equals "=". Rookie mistake but the resulting behavior was not loading the misspelled variables assignment.

    # dotenv sample content
    
    # correct assignment
    USER=sample@gmail.com
    
    # wrong assignment (will not load env var)
    USER : sample@gmail.com
    

提交回复
热议问题