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

amplify init stuck after choosing editor

Open aldarund opened this issue 8 years ago • 15 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce amplify init and then choose any editor ( doesnt matter which, result is same)

Expected behavior obv init project, continue with other questions etc

Screenshots https://i.imgur.com/wXyfkeO.png

Desktop (please complete the following information):

  • OS: Windows 10 x64 Node 11
amplify -v
0.1.29

aldarund avatar Oct 25 '18 22:10 aldarund

Same with me. Window 7 enterprise edition, Node10 amplify 0.1.29

bright-sea avatar Oct 26 '18 06:10 bright-sea

@aldarund Do you have windows subsystem for linux?

yuth avatar Oct 26 '18 16:10 yuth

@yuth i have it installed, but i dont use it and that behaviour happens without using wsl, using native windows

aldarund avatar Oct 26 '18 16:10 aldarund

@aldarund Currently amplify-cli needs WSL to work. Could you try with WSL

yuth avatar Oct 26 '18 16:10 yuth

hm. why it cant work on win without wsl? amplify configure worked fine.

aldarund avatar Oct 26 '18 16:10 aldarund

amplify uses Gluegun and gluegun doesn't work well in windows without WSL. We have opened an issue with them.

yuth avatar Oct 26 '18 16:10 yuth

This is happening to me too. I have installed WSL, but still doesnt work. Any idea?

rskinnerc avatar Nov 01 '18 15:11 rskinnerc

@VetBoard Could you please provide the error stack trace?

kaustavghosh06 avatar Nov 01 '18 16:11 kaustavghosh06

I'm sorry but there is no error... it just stuck there, with the cursor blinking, but nothing happens just after I select the editor.

rskinnerc avatar Nov 01 '18 16:11 rskinnerc

Yes, there no error stack trace. It just stuck doing nothing as in screenshot in my initial message

aldarund avatar Nov 01 '18 17:11 aldarund

Same issue here, stuck on selecting default editor

pt7892 avatar Nov 02 '18 12:11 pt7892

I was pretty frustrating and I spent some time to look into it. This issue is caused by inquerier component.

Unfortunately amplify-cli is not using the same version of all the dependencies. CLI itself using 3.2.1 and it has this issue, from 5.0.0 it is fixed.

I tried the inquerier versions 1 by 1 and 5.0.0 is the first one which runs their pizza example well, all the others are stuck after printing the json.

Internally the main reason is the setRawMode call to stdio's handle in readline module, my guess is that some pieces were not closed properly and TTY got into an invalid state.

If someone could create a PR, all you've to do is to move all the packages.json from ^3.2.1 to ^6.0.0 for the inquerier component so that would be the same for all modules ;-)

Pizza example: https://github.com/SBoudrias/Inquirer.js/blob/master/packages/inquirer/examples/pizza.js

Repro if someone wants to try:

  • npm init -y
  • npm i --save [email protected] (or 6.0.0) to see the difference)
  • node pizza.js

attilah avatar Nov 03 '18 17:11 attilah

@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

The 0.1.32 version fixed the issue for me. I just did npm install -g @aws-amplify/cli and everything worked properly.

Thank you

rskinnerc avatar Nov 09 '18 03:11 rskinnerc

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[bot] avatar May 27 '21 17:05 github-actions[bot]