News for hackers. Stuff that matters.
Re:Habits of a Happy Node Hacker by secretagent on Wednesday November 11, 2015 @11:14AM (#10547357)
Regarding point 9, if you don't check your `node_modules` into version control don't you run the risk of them disappearing from NPM?
Re:Habits of a Happy Node Hacker by hunterloftis on Wednesday November 11, 2015 @11:21AM (#10547388)
"If you are paranoid about depending on the npm ecosystem, you should run a private npm mirror or a private cache.

If you want 100% confidence in being able to reproduce the specific bytes included in a deployment, you should use an additional mechanism that can verify contents rather than versions. For example, Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs."

https://docs.npmjs.com/misc/faq#should-i-check-my-node-modul...

Re:Habits of a Happy Node Hacker by jtwebman on Wednesday November 11, 2015 @11:57AM (#10547599)
I think if you are worried about this you should be using Dockers and Docker Hub.
Re:Habits of a Happy Node Hacker by vog on Wednesday November 11, 2015 @11:48AM (#10547560)
Even when assuming availability, what about modules that change?

Either because authors "bugix" their existing versions and don't bother to increase the version number. Or because a malicious network actor delivered modified code.

That's why I prefer to add a SHA-256 hash/checksum to every downloaded dependency file. In some settings that hash might be more important than the actual version number.

Re:Habits of a Happy Node Hacker by LukeB_UK on Wednesday November 11, 2015 @12:26PM (#10547777)
npm only lets you publish a version once, if the version number already exists for that module, you have to change the version number
Re:Habits of a Happy Node Hacker by vog on Wednesday November 11, 2015 @06:51PM (#10550295)
Okay, that's good to know.

But I'm still uneasy with this, as the crypto hash approach provides some more safety features. For example, it protects against attacks the NPM platform itself (assuming they happen after you incorporated the library into your project). Also, it enables us to download the package from any other source (e.g. some archive/mirror), via plain HTTP, while still being safe from downloading a modified package.

That's why I still wish the crypto hashes were included in package.json (automatically on "install --save-exact", of course).

Re:Habits of a Happy Node Hacker by draw_down on Wednesday November 11, 2015 @02:35PM (#10548694)
Do you guys not use pip, and stuff? I'm surprised by all the confusion on this point. Package managers are part of modern programming platforms. Repos only need to have your code, not everyone else's.
Re:Habits of a Happy Node Hacker by thoughtpalette on Wednesday November 11, 2015 @11:29AM (#10547440)
That's a good point, I've never considered the possibility of a package I'm using disappear from NPM. I never check in my node_modules folder and let CI build processes handle all of that.
Re:Habits of a Happy Node Hacker by seivan on Wednesday November 11, 2015 @12:00PM (#10547617)
You could fork the libs and point to your own repo. That's what we usually did with Cocoapods.