23

Fuck you NPM

Comments
  • 1
    Fuck you, Abriviation that I do not understand!
  • 4
    @Cyanite pssst, i think he's taking about node package manager
  • 1
    @Cyanite node package manager
  • 2
  • 2
    You're welcome 😁
  • 1
    It's true!
    NPM is awful!
  • 1
    Curious, could you elaborate on npm issues?
  • 2
    Go yarn..
  • 2
  • 2
    @rusty-hacker npm install on an awesome ec2 instance seems to hate me. But i am a noob to the whole node.js framework
  • 3
    @dvncoder18 Amazon tends to have super old nodejs versions in their ami repos. Be sure to check the version, and install a more recent one directly from nodesource:
    https://nodejs.org/en/download/...

    If you want the ability to easily switch between node versions at any moment, nvm (node version manager) is a neat tool: https://github.com/creationix/nvm
  • 1
  • 1
    @rusty-hacker Here's a few reasons:

    NPM doesn't use a flat package store, meaning the node_modules subfolders can grow hundreds of levels deep for no actual benefit.

    There's also a bug wherein NPM silently fails to install arbitrary sub-dependencies. This bug has been around for... three years now? Four?

    Also, NPM encourages developers to take on huge numbers of dependencies, even so far as requiring a dependency just for left-padding a string, determining if an object is an array, etc. In this way, NPM seems to reinforce the myth in its users that "someone else's code is always superior." A very flawed belief.
  • 0
    @Ashkin Never reinvent the wheel... although if everyone keeps telling you that square wheels are awesome, it might be time to start from scratch.

    I often feel like when you write a reusable package yourself you should make it as lean as possible, to prevent catastrophically cascading branches of dependencies for your end users.

    In the end product, you can use all kinds of convenience libraries, but reusable code should be as pure and native to the language as possible.
  • 0
    You can try yarn
  • 1
    @Ashkin I think npm installs dependencies flat since npm3, though they will still nest in situations where multiple packages rely on the same package to avoid naming conflicts. So, still not great but I thought I'd put that out there.
  • 1
    @jantuno Appending the version to the directory name would bypass that issue entirely and create a perfectly flat structure.
  • 1
    @Ashkin Agreed. As I said, there's still work to be done there, just thought I'd give it a mention for interests sake. I use npm somewhat regularly and I'm no stranger to the pain it can sometimes inflict.
  • 0
    @Ashkin I don't think it encourages using a million dependencies.

    I think that is more lazy devs being lazy devs than anything.

    I do agree with the nested structure though, that was a dumb move.
  • 4
    If anyone gives a shit. I found the problem and now npm is bae
  • 0
    @dvncoder18 I give a shit ❤️
Add Comment