2023-07-05 15:11:16 +02:00
---
title: 'Non-Standard `NODE_ENV`'
---
2020-05-04 18:21:58 +02:00
2023-07-05 15:11:16 +02:00
## Why This Error Occurred
2020-05-04 18:21:58 +02:00
2020-05-28 11:10:22 +02:00
Your environment has a non-standard `NODE_ENV` value configured.
2020-05-04 18:21:58 +02:00
2020-05-28 11:10:22 +02:00
This may be by accident, so if you're unaware where the value is coming from, check the following:
2020-05-04 18:21:58 +02:00
2020-05-28 11:10:22 +02:00
- The `.env*` files in your project, if present
- Your `~/.bash_profile`, if present
- Your `~/.zshrc`, if present
The greater React ecosystem treats `NODE_ENV` as a convention, only permitting three (3) values:
- `production`: When your application is built with `next build`
2023-04-23 03:53:33 +02:00
- `development`: When your application is run with `next dev`
2020-05-28 11:10:22 +02:00
- `test`: When your application is being tested (e.g. `jest`)
Setting a non-standard `NODE_ENV` value may cause dependencies to behave unexpectedly, or worse, **break dead code elimination**.
2020-05-04 18:21:58 +02:00
2023-07-05 15:11:16 +02:00
## Possible Ways to Fix It
2020-05-04 18:21:58 +02:00
2020-05-28 11:10:22 +02:00
To fix this error, identify the source of the erroneous `NODE_ENV` value and get rid of it: Next.js automatically sets the correct value for you.
If you need the concept of different environments in your application, e.g. `staging`, you should use a different environment variable name like `APP_ENV`.
2020-05-04 18:21:58 +02:00
2023-07-05 15:11:16 +02:00
## Useful Links
2020-05-04 18:21:58 +02:00
- [Environment Variables](https://en.wikipedia.org/wiki/Environment_variable)