Aniket
Aniket

Reputation: 185

Globally installed node modules

I just had a question. I kind of know it's silly or the answer is obvious, but I still wanna ask to get it clarified.
Do we need to set the path for globally installed node modules?
I guess, setting the path for the global node modules directory is enough.

Upvotes: 0

Views: 745

Answers (1)

potatoxchip
potatoxchip

Reputation: 565

No you need not set path for each installed module, you need to only set the path environment variable for the root folder of global npm directory

Taken from this answer on SO

On Unix systems they are normally placed in /usr/local/lib/node or /usr/local/lib/node_modules when installed globally. If you set the NODE_PATH environment variable to this path, the modules can be found by node. Windows XP - %USERPROFILE%\AppData\npm\node_modules Windows 7, 8 and 10 - %USERPROFILE%\AppData\Roaming\npm\node_modules

I hope this answers your question

Upvotes: 1

Related Questions