-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute npm
cli commands with SEA
#115
Comments
npm install
with SEAnpm
cli commands with SEA
I tried bundling my app with npm as a dependency and calling the npm commands programmatically but this results in /**
* @param {string} directory
*/
export async function install(directory){
const npm = await import("npm");
const promise = new Promise(res => npm.commands.install([directory], (err, result, result2, result3) => {
res(err == null);
}));
const res = await promise;
} |
Related to #100 |
Why do you need |
The idea was to bundle custom code that already exists as a node cli package with the node runtime - one of the usecases for the cli we have is to manage/install/build npm packages so we need to run npm commands (or invoke the same functionality ideally in another way). Alternatively we could probably ship nodejs next to the cli tool - but we want to avoid requiring additional dependencies from users and control the installed node version. |
I've had success doing this with I bet other alternative package managers would work, too. |
Interesting, thanks for the heads up! I will test that! |
Hello,
I'm currently exploring possibilities for node SEA apps
Is it possible to access
npm
cli commands from my custom binary (or bundle the npm cli together with my sea app)E.g. a user downloads the custom binary
my_bin
then invokes
my_bin setup .
to setup a project in the current directorywhich internally will call the equivalent to
npm install
Alternatively I'd be curious to hear what the best solution would be for such a case without reinventing the wheel
The text was updated successfully, but these errors were encountered: