-2

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"

}
0

1 Answer 1

0

You can use the child_process API.

if (filename === ".tgz") {
  const { exec } = require("child_process");
  exec("npm install --save ../test/datemodule.tgz");
}
Sign up to request clarification or add additional context in comments.

1 Comment

Tried but not working

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.