'Express' is not recognized command (windows)

Okay I am running node on windows (7). Using npm I just installed modules to d:\ directory. Therefore my files structure looks like the following:

D:\
  -myproject
     -node_modules
        -.bin
        -express

However, when I am in this 'myproject' directory, I can't seem to run 'express' for example:

D:\myproject\express site
'express' is not recognized as an internal or external command, operable program or batch file.

Am I doing anything wrong?

Try:

npm install -g express-generator@3

That solved problem for me.

Here's what to type in the command line to make it work in windows:

npm install express-generator -g

[Source: http://expressjs.com/starter/generator.html]

My guess is that you didn't install Express globally. You can install express globally (and therefore available in your PATH) with the following command (see http://expressjs.com/guide.html) :

npm install -g express

The way you install it is available only in the folder that you installed it and there is nothing wrong with that approach. There is very little advantage of having it available globally.

If express is not in your PATH you can run it by entering the full path to it:

\myproject\node_modules\.bin\express.cmd

With the release of Express 4.0.0 it looks like you need to do

 npm install -g express-generator.

Express is loaded someplace else and not in the windows path environment variable. You need to find were express.exe is installed and add the path. Maybe something like ;"C:\Program Files\Express\bin";

I have the same problem and understand the solution, but i can´t undestand why, running npm install -g express, express.bat isn´t added automatically to Path.

Running with npm install -g express have the same result. Download packages and store in node_modules, but express.bat isn´t added to path.

What command are you using to open the directory?

That error means CMD can't find the "express" executable in the current directory.

Use the "PUSHD" command or "CD /D" instead of "CD"

@Echo OFF
PUSHD "D:\myproject\express" || (Echo bad folder)
express.exe "site"
Pause&Exit

Run the node command prompt as administrator and then install express globaly
npm install -g express
and then go to folder where you want to install express generator, open command prompt there and run this command
npm install express-generator, it will then fix the issue

Use npm start .. then the app.js runs .. which can be listened on the usual port 3000