Why is the `express` executable not working in my command prompt?

44 views Asked by At

I installed Node.js, then created a new folder on my C:\ and installed an Express skeleton using:

npx express-generator

Now I just want to see the express options using express -h, but when I do so it gives this error:

'express' is not recognized as an internal or external command, operable program or batch file.

This is the beginning of the tutorial I followed: https://expressjs.com/en/starter/installing.html

Is there a missing step or something? Where did this go wrong?

1

There are 1 answers

0
Lin Du On

express is a command name, see the bin configuration in package.json#L37.

"bin": {
  "express": "./bin/express-cli.js"
}

Also, have a look at the bin configuration of npm to know what's it.

You can install the express-generator globally, then use the express command to run the ./bin/express-cli.js script.

$ npm install -g express-generator
$ express -h