node-windows Local Installation #302
-
Hi, I read in the ReadMe that it is possible to install node-windows locally inside a project but it is recommended to install it globally. Just wanted to understand the potential issues if the installation is done locally inside a specific project (without the global flag). I did try a local installation and the service seems to be working fine, using the wrapper.js from within the local node_modules folder inside the project, but just wanted to confirm if there could be any potential issues in the future? If the local folder (where node-windows is installed) is never moved, could it still cause issues? Or will it only be an issue if that folder is moved? Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The primary reason for recommending a global installation is to prevent duplicate artifacts/module bloat. The library contains the winsw binary, so every time It's perfectly fine to use local installations if your use case warrants it. The main consideration is making sure to specify absolute paths for the script configuration attribute... which is no different than using node-windows globally. Another possibility is to install node-windows with a prefix. You'd have to get creative with this approach, but it's possible to simulate a global module installation using a directory outside of a user profile. If you use https://github.com/coreybutler/nvm-windows, you can install Node/npm outside of the AppData directory by overriding the installation path (or changing the root via the CLI). The bottom line: There are other options for global use if you want to use them, but local installations should be fine. |
Beta Was this translation helpful? Give feedback.
The primary reason for recommending a global installation is to prevent duplicate artifacts/module bloat. The library contains the winsw binary, so every time
npm install node-windows
runs, another copy is made. Additionally, a global node-windows update will impact all daemons simultaneously, instead of having to update each project individually. This can be a benefit if you run many background processes on a single server.It's perfectly fine to use local installations if your use case warrants it. The main consideration is making sure to specify absolute paths for the script configuration attribute... which is no different than using node-windows globally.
Another possibility is to ins…