简体   繁体   中英

No .env file found - Nuxt

I did move my source directory using srcDir prop. But when I start my local server console is giving me this error:

WARN No.env file found in ~\src nuxt:dotenv 11:19:47

Have you any ideas on how to fix this?

It is necessary to specify the path to the.env file via the path option in the dotenv module declaration.

nuxt.config.js

  buildModules: [
    // dotenv
    ['@nuxtjs/dotenv', { path: './' }],
  ],

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM