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

8,931 views
Skip to first unread message

Derek Barnes

unread,
Oct 1, 2013, 4:13:46 PM10/1/13
to expre...@googlegroups.com
Hey all, 

I'm completely new to Express and Node.js in general. I'm working through the book "Sams Teach Yourself Node.js in 24 Hours". 

Everything is fine until Ch. 6 which says to install Express:

npm install -g express

That seems to go fine...bunch of stuff looks like it's installing. I check the folder it has installed to (C:\Users\<myusername>\AppData\Roaming\npm\node_modules\express) and there are a bunch of files as expected.

Next I type:

express express_example

...and get the error:

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

I'm working under Windows 7 Enterprise.

Any thoughts why I can't get this to work?

greelgorke

unread,
Oct 4, 2013, 3:53:52 AM10/4/13
to expre...@googlegroups.com
you should repost it in the nodejs group since it's a general node/npm issue not an express issue: https://groups.google.com/forum/?fromgroups#!forum/nodejs

Paul Vencill

unread,
Oct 4, 2013, 9:08:00 AM10/4/13
to expre...@googlegroups.com

I think the command is different for windows, but I'm not on a windows env so I'm not sure what it should be

--
You received this message because you are subscribed to the Google Groups "Express" group.
To unsubscribe from this group and stop receiving emails from it, send an email to express-js+...@googlegroups.com.
To post to this group, send email to expre...@googlegroups.com.
Visit this group at http://groups.google.com/group/express-js.
For more options, visit https://groups.google.com/groups/opt_out.

Angel Java Lopez

unread,
Oct 4, 2013, 9:12:16 AM10/4/13
to expre...@googlegroups.com
Ah!

Maybe you have not NPM global modules in your path

Try add c:\Users\<youruser>\AppData\Roaming\npm to your path

I had a similar issue in one machine, Windows 8. I installed node.js with user A, I can use Node.js with user B, and NPM too. But in User B, I had to manually add the above folder to my path.

Angel "Java" Lopez
@ajlopez

Derek Barnes

unread,
Oct 10, 2013, 1:17:51 PM10/10/13
to expre...@googlegroups.com
Yup...this was it. Thanks so much!

kikit

unread,
Mar 5, 2014, 5:57:52 AM3/5/14
to expre...@googlegroups.com
I have facing the same problem and also follow the instruction given by Paul but i still getting the same error...... Plz help ...

Jonathan Ong

unread,
Mar 10, 2014, 1:40:32 AM3/10/14
to expre...@googlegroups.com
you want to install the generator now: https://github.com/expressjs/generator#quick-start

@nk

unread,
Feb 6, 2015, 3:04:16 AM2/6/15
to expre...@googlegroups.com
Hi,
try to run command

npm install -g express-generator

this will install additional files for Express 4.X
then run the command prompt as administrator
and try to execute express command to see it works

express -h


It worked for me
if it doesn't works
reinstall node.js 
and try again.
Reply all
Reply to author
Forward
0 new messages