search

Home  >  Q&A  >  body text

javascript - node_modules is extremely large, and many dependencies that are not included in package.json are also installed.

I first wrote the dependencies of package.json and then ran cnpm install
After running, node_modules is very large, and many unwritten dependencies are also loaded. Is there any way to press package? Does .json need to be loaded?

迷茫迷茫2746 days ago1075

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-06-20 10:08:54

    The dependencies in

    package.json also depend on other packages. Of course, they all need to be installed, otherwise your dependencies will not be used

    reply
    0
  • ringa_lee

    ringa_lee2017-06-20 10:08:54

    The package you depend on in package.json also has its own dependencies.

    Your package.json:

    "a":"^1.0.1"

    a’s package.json:

    "b":"^2.1.1"

    b is not in your package.json, but it must be downloaded, otherwise a will not work properly.

    b probably also depends on other packages.

    reply
    0
  • Cancelreply