Access node_modules from another folder

后端 未结 4 678
一向
一向 2021-01-17 18:08

Recently started working with Gulp and I can\'t figure out is it really necessary to have a copy of node_modules directly in folder with current project? E.g. I have this s

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 18:32

    One problem why you shouldn't do this is because of versioning. If your modules require different versions of the same package, you're going to run into problems. One package is going to win, and it might break another package.

    Further, you get into the problem of having to merge the dependency lists in some way - meaning, you'll have to get the dependencies from work/package.json, work2/package.json, etc. and then install all of them at once.

    Merging node_modules/ won't solve your problem, either - believe me, don't try.

提交回复
热议问题