amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

amplify init "type of app" doesn't actually allow selection Windows 10

Open bradthurber opened this issue 8 years ago • 28 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? When I do amplify init, it asks the first question about editor and I am able to select an editor. The next question about type of app I don't have a chance to answer. Note below that it looks like I picked javascript, but actually I just got my os prompt back

PS C:\Users\bradt\Documents\cs\react\my-amplify-app> amplify init
Note: It is recommended to run this command from the root of your app directory
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building (Use arrow keys)
  android
  ios
> javascript
PS C:\Users\bradt\Documents\cs\react\my-amplify-app>

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Run amplify init
  2. Select editor
  3. Notice no change to select type of app

What is the expected behavior? Should be able to select app type

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

Windows 10, latest version of Amplify CLI that gets installed (0.1.14)

bradthurber avatar Aug 27 '18 12:08 bradthurber

Can confirm that this isn't just on init. Any time there is a prompt, the choice fails out and kicks you back to the shell without letting you continue selecting choices. I believe something is silently failing.

mwarger avatar Aug 27 '18 13:08 mwarger

Hey guys, so I tried using the CLI with the Windows Linux subsystem(WSL) on windows and it works great. Highly encourage using the WSL for your Amplify development. We have updated our main README as well with the following.


If you're using Windows, the CLI currently supports [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10).

In the meanwhile, we're trying to figure out the root cause of the erroneous behavior of the CLI with the windows filesystem.

kaustavghosh06 avatar Aug 27 '18 23:08 kaustavghosh06

For reference, the option selection works for me in Powershell. Might be worth a try as an alternative to CMD?

ericathegreat avatar Aug 28 '18 01:08 ericathegreat

@ericathegreat It doesn't kick you out after the first selection?

mwarger avatar Aug 28 '18 12:08 mwarger

@mwarger No, I haven't had any issues with the actual interactions. What key are you pressing for selection? Spacebar?

ericathegreat avatar Aug 28 '18 22:08 ericathegreat

amplify init kicks me out, using Powershell. I down arrow to move the highlight/cursor for the editor (I've tried Code and None) ... if I hit spacebar at this point there's no effect ... so then I hit 'enter' and the 'type of app' prompt displays and I'm immediately returned to the PS prompt. Using Win 10 build 17741.rs5_release.189814-1439.

wstidolph avatar Aug 29 '18 01:08 wstidolph

@wstidolph checkout @mwarger post on using Windows Linux Subsystem(WSL) on native windows power shell out here - https://github.com/aws-amplify/amplify-cli/issues/13. I think it’s a great workaround and would highly recommend using WSL for the Amplify CLI.

kaustavghosh06 avatar Aug 29 '18 01:08 kaustavghosh06

@kaustavghosh06 - I believe this has been resolved with a recent release.

mwarger avatar Sep 20 '18 13:09 mwarger

@mwarger @kaustavghosh06 @wstidolph This is possible that my recent changes to gluegun fixed it on Windows. I would be interested to know if that's not the case. I'm pretty sure I can fix that issue.

kavengagne avatar Sep 22 '18 18:09 kavengagne

I think it did. I was able to install on a new machine a couple days ago and was able to make selections without any issues.

mwarger avatar Sep 22 '18 18:09 mwarger

I just tried with latest amplify-cli and init exits at frontend plugin selection.

I patched the sources to remove the frontend step and the issue is the same, it sliently exits.

So the issue is that the 2nd option is always exits. I tried to put the latest gluegun into the cli's node_modules dir, that did not help either.

attilah avatar Oct 08 '18 20:10 attilah

0.1.27 freezes during 'init' when choosing any editor.

stevegula avatar Oct 15 '18 17:10 stevegula

@stevegula @attilah Are you using windows without WSL?

kaustavghosh06 avatar Oct 15 '18 17:10 kaustavghosh06

@kaustavghosh06 yes, I tried in "windows windows", in WSL on the same machine, everything works...WSL is "not windows".

attilah avatar Oct 15 '18 17:10 attilah

@attilah We have an issue open with our dependent CLI framework for making it work on windows natively and are actively working with them to get the fix out. Until then we recommend using WSL.

kaustavghosh06 avatar Oct 15 '18 17:10 kaustavghosh06

@kaustavghosh06 I tried the @next from that cli library where the "path fix" was included and still had the same problem, but ok, let's wait. The problem is that working with WSL and Windows is not going back and forth, since some generated files are including the absolute path on the host machine /home/xyz/....... which does not map to the same location under Windows...

But sure working purely in WSL could do the trick.

attilah avatar Oct 15 '18 17:10 attilah

Same!

amplify -v 0.1.28 node -v v10.10.0

PS C:\Projetos> amplify init Note: It is recommended to run this command from the root of your app directory ? Choose your default editor: Visual Studio Code ? Choose the type of app that you're building (Use arrow keys) android ios

javascript PS C:\Projetos>

baldo12 avatar Oct 19 '18 00:10 baldo12

@stevegula @attilah Are you using windows without WSL?

Correct, I'm not using the Linux subsystem.

stevegula avatar Oct 24 '18 14:10 stevegula

We published a new version of the CLI to npm, version -> 0.1.32 with fixes for windows. Feel free to re-open the issue if the problem still persists.

kaustavghosh06 avatar Nov 05 '18 20:11 kaustavghosh06

@kaustavghosh06 This has not fixed the issue. I have clean installed these and am still not able to run the commands.

Amplify Config Amplify Init

bghtrbb avatar Nov 09 '18 03:11 bghtrbb