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

node.js, windows

Solution

It sounds like your error comes from an attempt to run something like this (which works in Linux):

NODE_ENV=development node foo.js

the equivalent in Windows would be:

SET NODE_ENV=development & node foo.js

running in the same command shell. You mentioned `SET NODE_ENV` did not work, but was not clear how/when you executed it.

Problem

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.

Original source

Related problems