Answer the question
In order to leave comments, you need to log in
How to run npm package from node?
Hello.
How to run npm package from node?
That's how I can, but it's still npm in the end, but is it possible to run npm specifically with a node?
const { exec } = require('child_process');
exec('npm run package', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question