Repository navigation
Is there any chance to offer access to the intern NodeJS and NPM binaries? #278
Replies: 2 comments
Bit of a late reply, but from my understanding of how pkg works, npm is never bundled so you definetly can't do that. As per the bundled node at least one option would be to setup a small script something like what is in the application below: This obviously isn't optimal and has a bunch of sandboxing issues (though you could probably use the vm module or something to make things at least a bit better) but it isn't really the intended use case for pkg either. If your plugins are node modules it's probably best you just get the user to install node (or you install it for them), an alternative would be bundling a runtime like quickjs but that adds a ton of complexity. Hope that helps a little. |
|
Thank you for your reply. In the meanwhile I implemented an autoamtic node installation as part of the apllication's installation. The user decides if he want to use the global node (if exists) or the local one. At least that way the node inside the application is always a fixed one. Plugins need to define the range of supported node versions. But I think this is the best option for now. |
Uh oh!
There was an error while loading. Please reload this page.
I'm developing a plugin system for an app. Each plugin is a folder containing a package.json file so the plugin is going to be installed using
npm install. The plugins resides next to the executable. The idea of making an executable for the app was users don't have to install NodeJS on their system. But I didn't thought of the plugins needing NodeJS.Is there any chance that pkg could offer the path to the built-in NodeJS and npm executables? That could allow us to call the intern
nodeandnpmcomamnds without the need of NodeJS installation for the user.All reactions