discord-live-translator icon indicating copy to clipboard operation
discord-live-translator copied to clipboard

.env: The system cannot find the file specified

Open TheCrazeMan opened this issue 1 year ago • 1 comments

Clony the repository. I used the terminal to specify the path to the folder: cd C:\Users\c920\discord-live-translator-main.

In the path: discord-live-translator-main\src. I've customized the env.ts file.

import { createEnv } from '@t3-oss/env-core';
import dotenv from 'dotenv';
import { z } from 'zod';

dotenv.config();

const env = createEnv({
  clientPrefix: 'PUBLIC_',
  client: {},
  server: {
    BOT_TOKEN: z.string(********),
    CLIENT_ID: z.string(***********).optional(),
    GUILD_ID: z.string().optional(),
    LOG_PATH: z.string().optional(),
    REDIS_URL: z.string().optional(),
    STT_HOST: z.string(),
    TRANSLATION_HOST: z.string()
  },
  runtimeEnv: process.env
});
export default env;

I run the bot and get an error

C:\Users\c920\discord-live-translator-main> docker compose -f docker-compose.prod.yml up -d Failed to load C:\Users\c920\discord-live-translator-main.env: open C:\Users\c920\discord-live-translator-main.env: The system cannot find the file specified.

Please help solve the problem

TheCrazeMan avatar Nov 16 '23 09:11 TheCrazeMan

I believe what is going on here are two things:

  1. If you modify the code but use the production Docker Compose file, the prebuilt container images hosted on GitHub will be used rather than using your version
  2. You've modified env.ts to configure your env. Instead you need to create a new file named .env - you can find a newly added .env.example in the repo, which you can use as a starting point

wotschofsky avatar Nov 17 '23 22:11 wotschofsky

Seems to be resoved!

wotschofsky avatar Jun 01 '24 12:06 wotschofsky

Yes. Thank you!

TheCrazeMan avatar Sep 09 '24 12:09 TheCrazeMan