Executes npm within a child_process spawn in order to prevent npm to take too much memory in the current one.
This module has been created to free the Kevoree Node.js runtime from npm's heavy memory usage.
** ⚠️ This module needs to be able to access the
npm executable in the PATH (if you have npm installed globally, then it should be ok)**
npm i exec-npm --save
var execNpm = ;// arguments to give to npm client// this is equivalent to a call to:// $ cd /where/to/install/modules// $ npm install minimist async expressvar cmd = 'install' 'minimist' 'async' 'express' '--prefix=/where/to/install/modules' ;;
NB. When you specify a
npmwill always append to it the
execNpm(args, options, callback): Function
- args: Array - command-line arguments to give to the npm client (see npm's help)
- options (optional): Object - child_process spawn options
- callback: Function - a function to be called when the process is done (first parameter is the error, if any)