I am just getting started with Express Js. Can someone explain the difference between
npm install
and
npm install -g express
(Installation code taken from enter link description here
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
-gflag means install Express in your global node_modules directory. This enables you to call theexpresscommand anywhere.npm install expresswould be used to install theexpresslibrary in your app, that is, you would navigate to your app directory and typenpm install express.I recommend that you do the following:
npm install -g expressThen when you navigate to your app directory, you’d type
npm link express. This symlinks to the global express install.Does this help?