I've created a cli to format my project and install some dependencies.
I try to run
const runNpm = () => {
return new Promise(resolve => {
npm.load(function(err) {
// handle errors
npm.commands.install(
["@angular/core", "@angular/cli --save-dev"],
function(err, data) {
if (err) {
reject(err);
}
console.log("dependencies installed");
resolve();
}
);
npm.on("log", function(message) {
console.log(message);
});
});
});
};
Without --save-dev it work perfectly
I've searched on internet, but couldn't find nothing.