Can't install packages without re-installing all binaries

cli
triaged

(Michael Wieczorek) #1

There’s a serious bug in NPM, and I can’t install packages into my electron/senantic-ui project without re-installing everything it seems.

Call my crazy, but isn’t a package manager supposed to only install the things you explicitly ask it to install?

What I Wanted to Do

Install a package (Lodash). It’s supposed to print a bunch of shit to the console and stop with the new package dependency listed in the package.json file

What Happened Instead

It downloads fresh binary packages for all the electron stuff (which is substantial) and the semactic-ui stuff because it uses an installer. When it finishes downloading the dependency (in this case, lodash), it re-downloads and tries to reload all these binaries, the starts the semantic-ui installer, which I have to quit (it’s already installed and configured, I don’t want to do that twice), so I Ctrl+C to stop this installer, I get an NPM error and the original package I want to install is not installed.

I want to install ONE thing, not refresh every damn thing fresh each time I want to add a dependency. It’s now not possible to install anything unless I go through all these installs of things that don’t need to be installed.

Is there a special flag I have to use to tell it to not refresh the entire f**ing dependency tree?

Oh, and after all is said and done, it corrupts the node-modules/electron stuff, so I have to install that over again. It also nukes my entire dependency tree, so I have to re-install the entire f**ing project tree - to INSTALL ONE PACKAGE.

Reproduction Steps

Start an electron project with semantic-ui and try installing a new package.

Details

This happens when I try and use Yarn, so it’s for sure a NPM problem

Platform Info

NPM 6.4.1
Windows 10
Using GitBash

$ npm --versions
6.4.1
$ node -p process.platform
win32

(Kat Marchán) #2

Think again. Yarn installs things in an npm-incompatible way. Switching back and forth between two package managers has its pain points, and this is one of them.