Live data from Hacker News

Disabling npm's progress bar yields a 2x npm install speed improvement

twitter.com

51–60 of 187 posts

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#51
post #14

Earlier quoted context omitted.

npm 2.x user here. Does anybody want to share a video of the 3.x progress bar? (Easy with QuickTime or CloudApp, btw)

https://www.youtube.com/watch?v=elWIVKWhWTk

I see that with iTerm 2, but using Terminal gives me a very different experience.

Here's a side-by-side: https://youtu.be/odoVfHHBYVM

Until recently, I had no clue iTerm was doing something weird. I just figured npm install was just ugly and incomprehensible.

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#52
I posted this below, but I'll post again here for visibility. What the heck is up with npm install on iTerm 2? I had no idea something was weird until recently, when I did an install with Termial.

Here's a side-by-side video: https://youtu.be/odoVfHHBYVM

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#53
post #40
post #37

Earlier quoted context omitted.

Could you expand on that? What causes it to be nondeterministic? I haven't had that experience but it's the second time I've read someone reference this behavior

I have a project that's shrinkwrapped. I check out a new copy of the project and run `npm install`. My co-worker does the exact same thing, his fails, yet mine successfully builds. An install of a shrink-wrapped should be deterinistic, i.e. either succeed or fail, but not both.

From that doc page it sounds like that should be deterministic? Even without shrinkwrapping, a fresh install from package.json with empty node_modules should be deterministic.

> The npm install command, when used exclusively to install packages from a package.json, will always produce the same tree. This is because install order from a package.json is always alphabetical. Same install order means that you will get the same tree.

> You can reliably get the same dependency tree by removing your node_modules directory and running npm install whenever you make a change to your package.json.

Maybe you're experiencing a bug, rather than some in-grained non-determinism in npm?

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#54
post #6

The funky progress bar is about the coolest thing with npm. They could let it take a minute if they wanted too and i would keep watching it with amazement.

Your statement captures my feeling of node.js developers quite well.

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#55
post #33

Earlier quoted context omitted.

Not everyone is you. While I agree that flashy graphics are silly in the command line, I find color-based highlighting to be quite useful.

> Not everyone is you. Never claimed that was the case. God speed with your colors. May they bring you fame and good fortune.

> Never claimed that was the case.

Whether you claimed it is not in question. You're saying "[color in the terminal] is the work of the devil", which has a clear intent to dissuade people from coloring terminal output. Which, frankly, is insanity. Most apps do it well nowadays: --color=auto/always/never, usually defaulting to auto.

So when GP says "not everyone is you", they mean be considerate. If you want color off, you're being catered for. But don't try and push that choice on everybody who isn't you.

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#56
post #37

Earlier quoted context omitted.

Could you expand on that? What causes it to be nondeterministic? I haven't had that experience but it's the second time I've read someone reference this behavior

Here are details from the docs: https://docs.npmjs.com/how-npm-works/npm3-nondet

> You can reliably get the same dependency tree by removing your node_modules directory and running npm install whenever you make a change to your package.json.

https://docs.npmjs.com/how-npm-works/npm3-nondet

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#57
post #21

Earlier quoted context omitted.

> Color and terminal graphics are the work of the devil. Or you know, it's 2016, and it's npm who does it badly.

I don't even want color and terminal graphics done goodly. I code with two monochrome terminals on the screen using vim and the command line.

Thanks for sharing!

As an undergrad, I had a 14.4 kbps modem, and an amber WYSE terminal. With that, I was able to do contract work. It reminded me of the amber monitor I had on my Apple II ten years before. A solid phosphor CRT with no shadow mask is a fine thing.

Colors on a modern LCD are great too; give it a chance!

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#58
post #40
post #37

Earlier quoted context omitted.

Could you expand on that? What causes it to be nondeterministic? I haven't had that experience but it's the second time I've read someone reference this behavior

I have a project that's shrinkwrapped. I check out a new copy of the project and run `npm install`. My co-worker does the exact same thing, his fails, yet mine successfully builds. An install of a shrink-wrapped should be deterinistic, i.e. either succeed or fail, but not both.

What's the error on the build that fails?

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#59
post #19
post #7

Earlier quoted context omitted.

Please refrain from adding unhelpful comments to the issue.

It is tremendously unfortunate that that needs to be said at all.

I guess it's GitHub's Eternal September. I'm all for more people having access to development tools, but GitHub really has to step up the tools available for managing issues/comments.

Re: Disabling npm's progress bar yields a 2x npm install speed improvement

#60
post #49

I'd also like to take the time to mention that the caching system when installing / other actions is extremely inefficient (for my times I have the progress bar turned off already and this is a project with around 80 modules shared between dev / prod): https://github.com/npm/npm/issues/10890 I started on a very (I would like to emphasize very a thousand times over) basic proof-of-concept to show how much faster it co…

Looks good. I wonder if it'd be too much scope creep to add extension points for LAN/proxy caching. I know of one small dev team who had a single ADSL connection shared between ~10 people - NPM downloads would have been painful.
Post reply on HN