how can I force npm 3 to install nested dependencies?

前端 未结 3 1731
無奈伤痛
無奈伤痛 2020-12-13 10:40

I just upgraded to npm version 3 and noticed one of the biggest changes it made is that it enforces a flat dependency tree.

Your dependencies will now

相关标签:
3条回答
  • 2020-12-13 11:03

    This is what happens when I don’t get enough sleep. The obvious solution somehow escaped me.

    $ cd node_modules/A/
    $ npm install
    $ cd ../../
    
    0 讨论(0)
  • 2020-12-13 11:04

    I've just ran into this issue and found an alternative to fix this issue. Since Node.js comes with NPM, the only way that I could think of was to downgrade to Node.js 0.10 version, which comes with an older version on NPM, which will install dependencies in the old fashion way. To downgrade I used NVM and ran nvm use 0.10.0. You can switch back and forth between npm versions by following this trick. Hope it helps!

    0 讨论(0)
  • 2020-12-13 11:07

    Have you tried --legacy-bundling for npm install?

    https://docs.npmjs.com/cli/install

    The --legacy-bundling argument will cause npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, can install the package. This eliminates all automatic deduping.

    0 讨论(0)
提交回复
热议问题