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?
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.
Installing Express Use the following command to install express: npm install express --save.
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.
In order to use Express you will first have to install Nodejs and the Node Package Manager (npm) on your operating system.
Set Your npm Path variable
c:\Users\\AppData\Roaming\npm
Restart Your CMD
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With