generator icon indicating copy to clipboard operation
generator copied to clipboard

bash: express: command not found...

Open richardlrzjw opened this issue 5 years ago • 3 comments

I have followed up with http://expressjs.com/en/starter/generator.html for express application generator, got this issue bash: express: command not found.... Tried on both windows 2016 and RHEL 8 , I got same issue. but fixed windows 2016 issue by add NODE_PATH in environment variable as NODE_PATH=C:\Users\Administrator\AppData\Roaming\npm\node_modules. but no luck on RHEL 8 by using echo 'export NODE_PATH="'$(npm root -g)'"' >> ~/.bash_profile && . ~/.bash_profile to add PATH in bash_profile. when I run which express, I got /usr/bin/which: no express in (/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/root/bin) in deed I do see express in the node_modules in /usr/lib/node_modules, there are two directories one is express and another one is npm. no problem to run node -v and npm -v. lost my idea, any comments?

Thanks in advance

richardlrzjw avatar Aug 04 '20 00:08 richardlrzjw

Hi @richardlrzjw, Can you confirm that you first ran the command npm install -g express-generator?

e-l-i-s-e avatar Oct 07 '20 20:10 e-l-i-s-e

@richardlrzjw please run the npm install -g express-generator command. The express command cannot be found without running the above command

oviecodes avatar Nov 08 '20 10:11 oviecodes

Thanks oviecodes and e-l-i-s-e, yes, that works for me now.

richardlrzjw avatar Nov 09 '20 04:11 richardlrzjw