sugarlabs / musicblocks-v4

A complete overhaul of Music Blocks
http://www.sugarlabs.org/music-blocks/
GNU Affero General Public License v3.0
76 stars 105 forks source link

Docs: Update Setup Guide for Windows #166

Open meganindya opened 2 years ago

meganindya commented 2 years ago

Description

The "Setup Development Environment" section is geared towards BASH-like shells. The guide is good for Linux distros and MacOS. However, on Windows, there might be differences. Update the guide to accommodate Windows installations.

impAkshat commented 2 years ago

I am on it.

impAkshat commented 2 years ago

Without Docker setup in windows is running fine. But the specific versions are not installed.

To install the specific versions, there are some problems-

  1. Loading scripts are not allowed in windows. After installing typescript and running tsc -v. There is this error- tsc : File C:\Users\akshu\AppData\Roaming\npm\tsc.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. There is some windows Power shell Execution Policies and the Default is Restricted. Although it can be changed by simply excuting 1 command (reference). But these Execution Policies are for security reasons and changing them might create problem for the user.

FIX CAN BE- No need to check the versions of installed scripts or warning the user about changing execution policies.

  1. To install the previous node version. We can use nvm. But in windows we have to install through installer and also have to use nvm-windows which is not developed by nvm as stated in nvm documentations -

for Windows, a few alternatives exist, which are neither supported nor developed by us

FIX CAN BE-

3) && is not a valid statement separator in windows so checking installations node -v && npm -v && tsc -v && ts-node -v && http-server -v will give error.

@meganindya can you once check which typescript are you using, because installing the requirements using this command will install the latest versions.

npm i -g http-server
npm i -g typescript
npm i -g ts-node
d-e-v-esh commented 2 years ago

&& works on PowerShell which is now considered as the main CLI for windows, cmd is dramatically inferior is just there for backward compatibility and I think most devs on windows use PowerShell with ExecutionPolicy RemoteSigned or something that lets them run scripts.

We can just put a disclaimer to use PowerShell instead of cmd and use node v14.17.0 in docs and say that you need ExecutionPolicy RemoteSigned to run scripts if they run into this problem and link them to this page.

impAkshat commented 2 years ago

I am using Poweshell only, && is not supported there also. image

d-e-v-esh commented 2 years ago

@impAkshat what version of PowerShell are you running? Check with this $PSVersionTable. This looks like PowerShell 5, it works in PowerShell 7.

impAkshat commented 2 years ago

Right I am using version 5.

d-e-v-esh commented 2 years ago

PowerShell 5 is very old, you should install PowerShell 7 latest version. That will work well.

meganindya commented 2 years ago

We should use Node v16. The workflows all run on Node v16.

meganindya commented 2 years ago

http-server, typescript, and ts-node at the global level aren't for the app. http-server can serve built files as an extra measure. If users have python installed, then can also run python3 -m http.server --bind 127.0.0.1 8080 (this command runs on unix-like systems). typescript and ts-node are also extra executables in case user wants to transpile or run a .ts script while developing. None of these are required by the app. typescript dependency used by the app is different from the global executable.

meganindya commented 2 years ago

As for node, installing nodejs executable should install npm as well. I'm not sure about the installation paths on Windows.

d-e-v-esh commented 2 years ago

@meganindya What should we add to the docs? There does not seem to be many problems for windows other than the ExecutionPolicy error and the && error in older versions of PowerShell. Should we just add these two points into the documentation?

LeelavathiChandu1 commented 11 months ago

Is this issue currently opened?