forge-dev-kit icon indicating copy to clipboard operation
forge-dev-kit copied to clipboard

Installing on Windows 10

Open ronaldborman opened this issue 2 years ago • 1 comments

Following the instructions in the Team '22 video, I ran into problems installing forge-dev-kit on Windows 10. Essentially the chosen template is copied to the installation folder but when yarn (which I have installed on my machine) is executed, the following error is returned: /mnt/c/Program Files/nodejs/yarn: 11: exec: node: not found

After a lot of checking and searching, I found out that because WSL2 is installed on my machine (as part of the forge installation) yarn is executed in a WSL2 session (even as I started 'npx @finesoftware/forge-dev-kit create file-explorer' on a Windows command prompt). AFAICT yarn is executed as a zx script (because it is preceded by a $) and that starts the WSL2 session as a bash alternative. In that session, the installed node environment on my machine isn't found, hence the error.

As I don't have much experience with WSL2, the only remedy I could think of is installing NVM and Node on WSL2 (see for instance The Easiest Way to Install Node.js on WSL, Mac & Ubuntu and then executing the npx command inside of WSL2 (starting the command on the Windows command prompt still doesn't work).

Perhaps there are better solutions for installing on Windows, but for now this works for me. Perhaps somebody else could benefit from this setup. Feel free to close the issue.

ronaldborman avatar Jun 24 '23 13:06 ronaldborman

Hi @ronaldborman , I had similar problem on other projects, the wsl in trying to use the node you have installed on your windows, the simple solution is to uninstall node from your windows and install it inside wsl using apt-get.

RafaelFigueiredo avatar Sep 20 '23 02:09 RafaelFigueiredo