Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Use integrated Node if not otherwise installed #44

Open
joshwcomeau opened this issue Jul 14, 2018 · 8 comments
Open

Use integrated Node if not otherwise installed #44

joshwcomeau opened this issue Jul 14, 2018 · 8 comments
Assignees
Labels
top priority Upcoming features of top priority upcoming feature New feature or request
Milestone

Comments

@joshwcomeau
Copy link
Owner

Right now, installing Guppy is a 2-step process:

  • Download and Install Node.js
  • Download and Install Guppy

Guppy is an electron app, though, and electron apps come with a built-in Node runtime! How cool would it be to no longer require a Node installation, by just using the bundled one if no system Node is found.

(I think we'd still want to use the system Node, when it's available, so that there's no difference between running scripts in a terminal vs. Guppy. But for the true beginner without Node, they shouldn't need to first worry about getting Node set up!)

If this proves to be challenging, we should at least prompt the user in-app to download Node if it isn't found (right now creating a project just fails mysteriously :/)

@superhawk610
Copy link
Collaborator

This should be possible using ELECTRON_RUN_AS_NODE (electron/electron#11515), per @GregorySchier on Twitter.

@joshwcomeau
Copy link
Owner Author

Yeah, awesome to hear that this is possible!

@joshwcomeau joshwcomeau added this to the v0.3.0 milestone Sep 10, 2018
@joshwcomeau joshwcomeau added the top priority Upcoming features of top priority label Sep 10, 2018
@joshwcomeau
Copy link
Owner Author

Note that we might want to hold off on this for a moment, as our switch to electron-builder (#26, #236) might affect how this works

@joshwcomeau joshwcomeau self-assigned this Sep 22, 2018
@joshwcomeau
Copy link
Owner Author

Gonna start taking a look at this =D

@joshwcomeau
Copy link
Owner Author

Ok, so I've run into a number of issues with this. I think it's worth doing, but it's probably not worth blocking 0.3 over.

Moving it to 0.4

@joshwcomeau
Copy link
Owner Author

I asked on SO, to see if there's a simpler solution we're missing: https://stackoverflow.com/questions/52470403/how-do-i-use-electrons-built-in-node-instance-for-running-tasks

@KenEucker
Copy link

@joshwcomeau I followed your stack-overflow post to this project and wanted to check in with you and see if you were able to take advantage of the built in node for your project. I have a similar application that I am working on and being able to use the built in node would help me with a roadblock I am experiencing.

Did you find a solution for this?

@AWolf81
Copy link
Collaborator

AWolf81 commented Dec 14, 2018

Not sure if Josh made any progress on this.
I've tried to setup a minimal example with electron-fiddle and you can find the gist here.

But still no luck. But with the fiddle it's easier to test as you can start the binary of electron-fiddle and edit the project with-out a Node version in the system path.

The mentioned fork in the other SO question wasn't working. Seems like it's doing something in a separate thread with-out returning anything but I haven't check that. Any way we need exec/spawn for the app.

I need to check how to call the Electron helper Josh mentioned from Electron then I can try to find a solution for the issue mentioned in th SO question - yarn not finding node.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
top priority Upcoming features of top priority upcoming feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants