Skip to content

Instantly share code, notes, and snippets.

View garretfick's full-sized avatar

Garret Fick garretfick

View GitHub Profile
@garretfick
garretfick / npm-one-by-one.js
Created December 5, 2016 07:54
Install npm pacakges from a list
// Installs NPM packages from a generated list
// 1. Generate the list with ls node_modules > modules.txt
// 2. Run node npm-one-by-one.js
// This is primarily useful for populating a Nexus proxy when npm install sometimes fails
const fs = require('fs')
const cp = require('child_process')
// The maximum time we try to install any package before giving an error
const TIMEOUT_SECONDS = 30