Denis
Denis

Reputation: 17

Why do i have to put "-g" on npm install command?

I am new to node.js, everything is running fine right now for me, but i am interested in something, on all tutorials i have seen, it is simple to install packages, for example, when they install express, they write:

npm install express

but in my console, i have to write

npm install express -g

The first one gives me error while trying to install the package. Is this caused because i have installed windows and i use command prompt?

Upvotes: 0

Views: 105

Answers (1)

Omar Lahlou
Omar Lahlou

Reputation: 1000

To install express as a global package, you need to add -g param.

If you don't use the -g param, you will need to install express for every local node_modules folder.

For more information, please check https://docs.npmjs.com/cli/install

Upvotes: 3

Related Questions