Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

win7 express js: 'express' is not recognized in cmd

I have node.js installed and running fine on windows 7 computer. I run

> npm install -g express
> npm install -g express-generator
> npm install -g express-generator@3

and they all install successfully. But when I go to a new folder and try:

> express myproject

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

I see 'express', 'express.cmd', and 'node_modules' directory with 'express' and 'express-generator' folders in the C:\Users\ME\AppData\Roaming\npm directory

I added the npm directory to my PATH in case that was missed.

I tried all the solutions I could find:

'Express' is not recognized command (windows)

https://groups.google.com/forum/#!topic/express-js/Cr92_LC_pUk

what else can I try to get express working?

like image 721
Cbas Avatar asked Jun 25 '14 23:06

Cbas


People also ask

Why npm command is not working on CMD?

The error “npm is not recognized as an internal or external command” error may occur because either the npm is not installed or it is not added to the windows path. To resolve this error, the first solution is to install Node. js on Windows as Node. js is equipped with npm by default.

What is the command to install Express JS?

Installing Express Use the following command to install express: npm install express --save.

How do I know if Express is installed?

How do I check my version of Express? Another way is to open up your codebase and check the package. json file where you will be able to see all the packages installed along with its version number. for local package use command npm list.

Is Express installed with node?

In order to use Express you will first have to install Nodejs and the Node Package Manager (npm) on your operating system.


2 Answers

  1. Set Your npm Path variable

    c:\Users\\AppData\Roaming\npm

  2. Restart Your CMD

like image 78
maddy Avatar answered Sep 28 '22 01:09

maddy


Check that you have the path to the express folder in the path. remember that you need to reopen cmd to apply the changes in the environment variables as modifying them does not modify the variables of the currently working processes, AFAIK. If you are changing system-wide environment variables, you may need to restart Windows.

You also may need to check if PATHEXT contains .CMD extension.

like image 20
Alex Netkachov Avatar answered Sep 28 '22 01:09

Alex Netkachov