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

npm run dev breaks on windows #5

Closed
KulkarniSuraj opened this issue Sep 28, 2020 · 4 comments · Fixed by #6 or #7
Closed

npm run dev breaks on windows #5

KulkarniSuraj opened this issue Sep 28, 2020 · 4 comments · Fixed by #6 or #7
Assignees
Labels
bug Something isn't working

Comments

@KulkarniSuraj
Copy link
Contributor

KulkarniSuraj commented Sep 28, 2020

Bug Description
npm run dev command does not work on windows

To Reproduce
Steps to reproduce the behavior:

  1. cd express-autodocs
  2. run npm install
  3. run npm run dev
  4. Error message: 'NODE_ENV' is not recognized as an internal or external command

Expected behavior
NODE_ENV is set to development and run index.js

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop :

  • OS: Windows 10

Additional context
The error occurs because NODE_ENV=development node index.js syntax is not supported by windows

Possible Solutions

  1. Using modules like cross-env or dotenv for managing environment variables
  2. handling environment variables in index.js
@prafulla-codes
Copy link
Owner

Thank you for letting me know this issue, I will get back to you in a few minutes 😁

@prafulla-codes prafulla-codes linked a pull request Sep 29, 2020 that will close this issue
@prafulla-codes
Copy link
Owner

@KulkarniSuraj, this issue is now fixed, Thank you 😇

The changes have been added to the latest version @ v0.0.2-beta.1, make sure to pull from master to get the latest changes :)

@prafulla-codes
Copy link
Owner

Oh wait, It breaks in the production mode 😂

@prafulla-codes prafulla-codes linked a pull request Sep 29, 2020 that will close this issue
@prafulla-codes
Copy link
Owner

prafulla-codes commented Sep 29, 2020

Fixed it by using dotenv module to create .env file which sets the environment to development when we run the dev script
Checkout PR #7 for more details.

Thank you 😇 Make sure to pull the changes

prafulla-codes added a commit that referenced this issue Sep 29, 2020
@prafulla-codes prafulla-codes self-assigned this Sep 29, 2020
@prafulla-codes prafulla-codes added the bug Something isn't working label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants