“NODE_ENV” is not recognized as an internal or external command, operable command or batch file

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

Leave a Comment