Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt: possible to relocate "node_modules" for plugins?

Tags:

gruntjs

If I install any grunt plugin, it is added to a folder named "node_modules" in the root of my project dir per default.

My question: is it possible to move this whole folder (and therefore all plugins) to another location (but still within my project folder), let's say to "build/node_modules" ?

Of course, I still want to be able to run grunt from anywhere in my project hierarchy after this change.

like image 222
frontend_dev Avatar asked May 24 '13 15:05

frontend_dev


2 Answers

Nope, that's a feature of the Node.JS core files. In the case you don't know, Node.JS is the platform which Grunt was built.

All require() calls which don't point to an absolute file or start with ./ will try to find modules inside node_modules folders.

like image 126
gustavohenke Avatar answered Nov 08 '22 14:11

gustavohenke


You can use symbolic link ln -s /original_node_modules_path/node_modules ./node_modules

like image 42
Toni Chaz Avatar answered Nov 08 '22 14:11

Toni Chaz