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

Couldn't set Node variables in Windows terminal [learn/database] #974

Open
halimahexe opened this issue Jun 7, 2024 · 1 comment
Open

Comments

@halimahexe
Copy link

For some reason, despite looking up the correct way to set Node variables in a Windows terminal, I wasn't able to do so in the terminal. Instead I had to install dotenv, create a .env file and put require('dotenv').config() in my code. It might be worth highlighting this to other Windows users.

@halimahexe
Copy link
Author

I've actually worked out that I was using the wrong command for Powershell. It should be:

$env:DB_FILE='db.sqlite'; node database/db.js

or

$env:DB_FILE='test.sqlite'; node test/tasks.test.js

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

No branches or pull requests

1 participant