Skip to content
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

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

Closed
bradthurber opened this issue Aug 27, 2018 · 28 comments
Closed
Labels
windows Issues tied to running the CLI on Windows

Comments

@bradthurber
Copy link

bradthurber commented Aug 27, 2018

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)

@mwarger
Copy link
Contributor

mwarger commented Aug 27, 2018

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.

@kaustavghosh06 kaustavghosh06 added the windows Issues tied to running the CLI on Windows label Aug 27, 2018
@kaustavghosh06
Copy link
Contributor

kaustavghosh06 commented Aug 27, 2018

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.

@ericathegreat
Copy link

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

@mwarger
Copy link
Contributor

mwarger commented Aug 28, 2018

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

@ericathegreat
Copy link

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

@wstidolph
Copy link

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.

@kaustavghosh06
Copy link
Contributor

@wstidolph checkout @mwarger post on using Windows Linux Subsystem(WSL) on native windows power shell out here - #13. I think it’s a great workaround and would highly recommend using WSL for the Amplify CLI.

@mwarger
Copy link
Contributor

mwarger commented Sep 20, 2018

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

@kavengagne
Copy link
Contributor

@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.

@mwarger
Copy link
Contributor

mwarger commented Sep 22, 2018

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.

@attilah
Copy link
Contributor

attilah commented Oct 8, 2018

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.

@stevegula
Copy link

0.1.27 freezes during 'init' when choosing any editor.

@kaustavghosh06
Copy link
Contributor

@stevegula @attilah Are you using windows without WSL?

@attilah
Copy link
Contributor

attilah commented Oct 15, 2018

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

@kaustavghosh06
Copy link
Contributor

@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.

@attilah
Copy link
Contributor

attilah commented Oct 15, 2018

@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.

@baldo12
Copy link

baldo12 commented Oct 19, 2018

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>

@stevegula
Copy link

@stevegula @attilah Are you using windows without WSL?

Correct, I'm not using the Linux subsystem.

@kaustavghosh06
Copy link
Contributor

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.

@bghtrbb
Copy link

bghtrbb commented Nov 9, 2018

@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

@kaustavghosh06
Copy link
Contributor

@bghtbb can do run ‘amplify -v’ and check which version of the CLI you’re using?

@bghtrbb
Copy link

bghtrbb commented Nov 9, 2018

@kaustavghosh06 0.1.32

Amplify Version

@bghtrbb
Copy link

bghtrbb commented Nov 9, 2018

@kaustavghosh06 So I installed it globally as referred by VetBoard on #355 and it works fine. However, it does not work when installed locally on the project as a dev-dependancy. I do it this way as part of my CI workflow and not to run into that "well it works on my machine" situation. Is there a way to fix it for that situation?

@attilah
Copy link
Contributor

attilah commented Nov 12, 2018

@bghtrbb I just tried it in an empty directory with the latest npm published version:

  • npm init -y
  • npm i -D @aws-amplify/cli
  • node_modules.bin\amplify.cmd

And if worked flawlessly.

@pdeak
Copy link

pdeak commented Jan 3, 2019

I still get this exact same issue on Node v11.6.0, Amplify 0.1.38 and Widows 10. It doesn't make a difference if amplify is used from the local node_modules or global installation.

@dmhalejr
Copy link

dmhalejr commented Jan 3, 2019

I don't think this problem is something in regards to Amplify CLI itself but maybe to do with inquirer dependency which leverages the prompt.

return inquirer.prompt(selectFrontendHandler)

Just as a friendly road sign, I'd recommend if you can on Windows 10 to leverage the Ubuntu subsystem as a workaround for now. I'm still running into the issue in PowerShell but had success utilizing the subsystem without any issue.

Going to be digging into that dependency package and see if I can figure out the why? to the uh?

Best wishes everyone!

@pdeak
Copy link

pdeak commented Jan 4, 2019

I finally got it working, just leaving this here in case it helps anyone else.

Using WSL did not make a difference. I also tried using several different command windows and shells (Powershell, cmd, cmder, Consolez, bash) and none if it made a difference. I also tried running a linux terminal using docker (docker -it) and running amplify init in there, and still I would have the exact same issue.

How I eventually got it working is that I switched from using yarn to npm. Using npm with a global install of @aws-amplify/cli works now, and I can choose the app type on the second step of amplify init.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
windows Issues tied to running the CLI on Windows
Projects
None yet
Development

No branches or pull requests