5 ms·
NPM and the community that surrounds it is a nightmare. I guess you could be talking about Bower but either way they are far from good,let alone best.
by donatj 11y ago
NPM and the community that surrounds it is a nightmare. I guess you could be talking about Bower but either way they are far from good,let alone best.
- Wintamute 11y agoI was talking about npm. And I find the JS community welcoming, friendly and passionate and for the more serious npm modules out there highly technically literate, but hey it's a subjective thing I suppose :/
- kuschku 11y agoSo, the package manager that doesn’t do proper deduplication and, thanks to nested dependencies, runs over the file path length limit on multiple platforms?
- Silhouette 11y agoFYI, the nesting and deduplication were fixed in NPM 3. It uses a flat structure now. Unfortunately, in their place the version resolution algorithm is now subject to order dependency: the same package.json file, run at the same time with the same packages available in the NPM repository, can give different results on different machines depending on what had already been installed.
- paulddraper 11y agoYep. Solved long file paths. All we had to give up was determinism!
- its2complicated 11y agoHa ha, the effing path length limit drove me crazy! There'd be 50 node_modules folders and Windows wouldn't let you delete anything; It was nuts! I had to start renaming directories to "a", "b", "c", and so on until I cut the size down. I like JS for quick personal projects, but I'm glad I don't use it professionally anymore.
- Matachines 11y agoAgreed. The JS community has some great people but in general it's very immature.
- Matachines 11y agoAgreed. The JS community has some great people but in general it's very immature.
- overcast 11y agoCan you give me examples of this? Everything I've used regarding NPM has been awesome. Stupid easy to use and integrate.
- Silhouette 11y agoOK, here's an everyday example. Suppose you and I are working on a front-end project, all neatly set up with package.json and so on in place. We've been working on different new features, adding in a new package or two from NPM in the process. We both fetch each other's latest changes to in-house code from source control. What NPM command do we run to make sure we also have the same packages installed and are actually running the same code?
- overcast 11y agopackage.json version control and npm update? npm install --save will install the package you want, and add it to package.json Why wouldn't your repo merge package.json between your changes? I'm doing the same thing when I merge changes to production. I add packages as I work on things at the desktop, and sync changes to production server.
- Silhouette 11y agoUnfortunately, the regular package.json and related npm commands are built around semver, and typically also only specify direct dependencies. Either of those alone is enough to violate the simple condition I gave many times over on a real project, because it means you can't in practice guarantee that two developers are even running the same code. It's actually worse with the latest NPM changes that flattened the tree in node_modules, because now there are order dependencies affecting which versions of things you get as well. The closest NPM has to an answer for this is shrinkwrap, but that adds a lot of complexity of its own, and still has limitations. In fact, there's a note at the bottom of the npm shrinkwrap documentation page suggesting that if you really want to control your dependencies robustly, you need to check everything into source control -- which is obviously the sensible thing to do, except that because npm does magic in node_modules that can involve all kinds of funky build steps, you're not checking in just the source for the modules you depend on, but might have all kinds of other artifacts that may or may not be portable as well. In short, it is all but impossible in practice to use Node and NPM to satisfy the most basic of development requirements: getting all of your developers (or production systems, for that matter) to actually run exactly the same code. If that's not a catastrophic failure to meet the requirements for a package management system, I don't know what is.