N
N
nezzard2018-05-02 17:57:34
Node.js
nezzard, 2018-05-02 17:57:34

Is it possible to install a program with Node js?

Good afternoon, I'm interested in whether it is possible to install programs using node js?
The application on node js has a dependency on the installed VLC on the computer. I wanted to check if vlc is installed at startup or not, if not, then install it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2018-05-03
@bingo347

There is a child_process module that allows you to run external applications.
Further actions depend on the type of OS, which can be found from process.platform
on osX. Install via brew
on linux. Analyze the output of the lsb_release command and, depending on the distribution, use its package manager
on Windows
. vlc is in the off-store, which can be managed using a PowerShell script
, I will also add that in the package.json in the scripts section, you can specify the postinstall task, which will be executed automatically after installation from npm

V
Vladimir, 2018-05-02
@Casufi

Not node js but npm
Here is an example package that installs
https://www.npmjs.com/package/windows-build-tools

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question