Globally instaling packages doesn't work (node.js, npm)

For example I installed express with global (-g) parameter. In node.js/node_modules folder express doesn't exists.

I tried to install it without global parameter and it works perfectly.

How to install it globally?

Thanks.

Installing modules via npm with -g is only for modules that provide command-line utilities, not for making any ordinary module accessible from anywhere.

So if you are looking to use the command-line express project generator utility/command, you need to use npm install -g express-generator instead.

If you want to require('express'); in your application, then you need to install express with npm install express.