I'm trying to setup an environment for a Node.js app. but I'm getting this error every time.
"NODE_ENV" is not recognized as an internal or external command, operable command or batch file.
What does this mean and how can I solve this problem?
I'm using Windows and also tried set NODE_ENV=development
but had no luck.
NODE_ENV is an environment variable that stands for node environment in express server. The NODE_ENV environment variable specifies the environment in which an application is running (usually, development or production).
You cannot override NODE_ENV manually. This prevents developers from accidentally deploying a slow development build to production.
Node. js assumes it's always running in a development environment. You can signal Node. js that you are running in production by setting the NODE_ENV=production environment variable. This is usually done by executing the command.
I wrote a module for this: win-node-env.
It creates a NODE_ENV.cmd
that sets the NODE_ENV
environment variable and spawns a child process with the rest of the command and its args.
Just install it (globally), and run your npm script commands, it should automatically make them work.
npm install -g win-node-env
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With