control-freak-ide/server/nodejs/testInstaller.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

24 lines
611 B
JavaScript

var npm = require("npm");
var path = require("path");
npm.load({
loaded: false
}, function (err) {
let target = path.resolve("./testPackage");
let last = process.cwd();
process.chdir(target);
console.log('p',process.cwd());
// catch errors
npm.commands.install(['.'], function (er, data) {
// log the error or data
//data && console.log('install',data);
if(er){
console.error('err',er);
}
});
npm.on("log", function (message) {
// log the progress of the installation
//console.log('log',message);
});
});