I am developing a NodeJS application. It will be deployed with Electron. This is good because all I will need to do is to package my application in an app folder inside the Electron package, then rebrand it as described on the official Electron documentation, and I will be ready to install it on any computer.
In particular, deploying with Electron means that I don't need to have NodeJS installed on my user's computer, because the Electron package is itself a NodeJS interpreter so it is going to run out of the box completely on its own.
Now, when I installed NodeJS on my system I also got npm installed along with it. Which means that whenever I need to install a package, I can just use it from command line.
Now, the program I need to deploy will keep a repository synced and updated by pulling it from github when needed. I found a wonderful NodeJS binding for Git, nodegit, that works on its own without any need of installing anything on the target computer, which is good because I am not sure my users will have git installed. Now, every time I pull my repository I will also need to do some npm install
.
Which brings up my question: I know that there is a library npm
that I can use to use npm programmatically from any NodeJS program. However, is that npm
library a standalone thing, or it depends on the installation of npm
on the system? If so, how can I work around this problem? I need to be able to do an npm install
from an Electron app deployed somewhere on an user environment that I can't assume to have anything else installed, npm in particular.