Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve .env environment variable loading error on Windows #33

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

sikatikenmogne
Copy link
Contributor

This pull request resolves the .env loading error on Windows by using cross-env added as a dev dependency.

Error

yarn dev

yarn run v1.22.22
$ GOOGLE_ANALYTICS_ID= nodemon ./src/index.ts
'GOOGLE_ANALYTICS_ID' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Changes

  • Installed cross-env as a dev dependency by using yarn add --dev cross-env.
  • Modified the dev script in package.json to use cross-env for setting environment variables.

How to Test

  1. Run yarn dev on both Windows and Unix-based systems to ensure that the environment variable GOOGLE_ANALYTICS_ID is set correctly and the application starts without errors.

Additional Notes

  • Ensure to run yarn install to install the new dev dependency cross-env.

…ing cross-env

This commit is about to resolve an error that i have encoutered after running `yarn dev` on Windows:

```
yarn dev
yarn run v1.22.22
$ GOOGLE_ANALYTICS_ID= nodemon ./src/index.ts
'GOOGLE_ANALYTICS_ID' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

by using cross-env added as a dev dependency on the package.json on the `scripts.dev` statement
@pythonbrad
Copy link
Member

@sikatikenmogne, thanks for your contribution 👍🏿 .

@sikatikenmogne
Copy link
Contributor Author

@sikatikenmogne, thanks for your contribution 👍🏿 .

I've also setup a devcontainer 📃FR. I mean, a containerized (Docker based) development environment using vs-code or any Jetbrains IDE for windows user to avoid this kind of issue in the future btw.

@rakici rakici merged commit 77aae1a into osscameroon:main Aug 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants