Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash: express: command not found... #276

Open
richardlrzjw opened this issue Aug 4, 2020 · 3 comments
Open

bash: express: command not found... #276

richardlrzjw opened this issue Aug 4, 2020 · 3 comments
Labels

Comments

@richardlrzjw
Copy link

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

@e-l-i-s-e
Copy link

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

@oviecodes
Copy link

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

@richardlrzjw
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants