简体   繁体   中英

is it necessary to have node_modules folder created for every project while using grunt

while using grunt node_modules directory is created for every project I create and their is a lot of duplication going on, which I don't like....

I am using grunt-collections now but it is very inefficient, and looking for an alternative solution for this. I don't know much about node but is it not possible to use grunt modules from the central node_modules directory within nodejs directory????

Edit: Is their any way to install packages globally...????

yes, it is necessary. First, to deal with grunt version mismatch issues, all the global grunt command really does is delegate to a local grunt dependency installed in your project's node_modules directory.

Second, you really want a local version of your grunt plugins/modules as well. Having everything installed locally to each project allows you to have two separate projects on the same machine that depend on different versions of the same grunt plugin. This would not be possible if everything was installed globally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM