H, I am trying to install one module by scripting method but i do not know how to install that by node scripting language or if you have any idea please share with me.
if(filename==".tgz"){
//How to run this command?
"npm install --save ../test/datemodule.tgz"
}
1 Answer 1
You can use the child_process API.
if (filename === ".tgz") {
const { exec } = require("child_process");
exec("npm install --save ../test/datemodule.tgz");
}
answered Aug 1, 2019 at 8:48
Jack Bashford
44.3k11 gold badges56 silver badges84 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
Sitharth
Tried but not working
lang-js