D
D
Dmitrii Solovev2015-10-08 23:52:39
Node.js
Dmitrii Solovev, 2015-10-08 23:52:39

How to fix npm 3?

I updated npm to version 3 and noticed a difference in the location of the packages. In a project, before, for example, it was like this, in node_modules, each installation creates a folder and puts its dependencies in node_modules recursively.

node_modules/
├── autoprefixer-loader
├── babel-core
├── babel-loader
├── css-loader
├── extract-text-webpack-plugin
├── jade
├── jade-loader
├── less
├── less-loader
├── lodash
├── style-loader
├── webpack
└── webpack-dev-server

on version 3, all packages and dependencies are poured into one root node_modules Is this some kind of bug or what? how can this be fixed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-10-09
@dimonnwc3

it's just that npm now does dedupe by default , before you had to pull it yourself, now it doesn't.

K
Konstantin Kitmanov, 2015-10-09
@k12th

Well, that's how it was, but it wasn't. npm 3 will try to keep the dependency tree as flat as possible. For details, welcome to the changelog.

Is this some kind of bug or what? how can this be fixed?
Do you care what's going on in this folder? :) In any case, you shouldn't edit anything with the pens. If something doesn't work - write bug reports, npm 3 is still in beta.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question