Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@rusty-hacker npm install on an awesome ec2 instance seems to hate me. But i am a noob to the whole node.js framework
-
@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 -
Root797738y@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. -
@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. -
jantuno2158y@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.
-
Root797738y@jantuno Appending the version to the directory name would bypass that issue entirely and create a perfectly flat structure.
-
jantuno2158y@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.
-
@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.
Fuck you NPM
undefined