News for hackers. Stuff that matters.
Re:Npm operational incident, 6 Jan 2018 by N_A_T_E on Sunday January 07, 2018 @03:57PM (#16092659)
I agree in principal about not relying on npm during deployment. For a novice, what is the best way to ship modules?
Re:Npm operational incident, 6 Jan 2018 by md224 on Sunday January 07, 2018 @04:10PM (#16092730)
My first thought was “What about including node_modules in your version control?” Downside is that the repo would be much larger, but if it’s going to expand to that size on the client after running “npm install”, maybe that’s not a big deal? But it feels kinda wrong to do that...
Re:Npm operational incident, 6 Jan 2018 by acemarke on Sunday January 07, 2018 @04:49PM (#16092941)
Committing your `node_modules` is a bad idea. The best answer is to either use an offline cache of package tarballs that have been committed to your repo, or an NPM caching proxy.

Yarn has an "offline mirror" feature built in, and Shrinkpack is a tool that can create an offline mirror based on an npm-shrinkwrap.json file.

I wrote about using Yarn's offline mirror here: http://blog.isquaredsoftware.com/2017/07/practical-redux-par...

Re:Npm operational incident, 6 Jan 2018 by djsumdog on Sunday January 07, 2018 @04:59PM (#16092986)
I know you can use JFrog/Artifactory to cache pulls of Jar files from maven repos, as well as Docker images. Does JFrog support node?
Re:Npm operational incident, 6 Jan 2018 by Qerub on Sunday January 07, 2018 @06:12PM (#16093316)
Re:Npm operational incident, 6 Jan 2018 by acemarke on Sunday January 07, 2018 @06:06PM (#16093288)
I haven't actually used an NPM caching proxy myself. It looks like Artifactory does support acting as an NPM proxy. The other tools I've heard of are Sinopia, Verdaccio, and local-npm.

Addy Osmani has a related article at https://addyosmani.com/blog/using-npm-offline/ .

Re:Npm operational incident, 6 Jan 2018 by vePhi4le on Sunday January 07, 2018 @07:09PM (#16093632)
Re:Npm operational incident, 6 Jan 2018 by andrethegiant on Tuesday January 09, 2018 @12:04AM (#16103769)
yarn's "offline mirror" blog post[1] has been super helpful — I was able to set one up in less than 30 minutes.

[1] https://yarnpkg.com/blog/2016/11/24/offline-mirror/

Re:Npm operational incident, 6 Jan 2018 by always_good on Sunday January 07, 2018 @05:06PM (#16093018)
That would break when going cross platform for modules with native deps.
Re:Npm operational incident, 6 Jan 2018 by vjn on Monday January 08, 2018 @12:14AM (#16094800)