aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.82k stars 820 forks source link

amplify configure - Error "spawn xdg-open ENOENT" #12004

Open hoanguyen94 opened 1 year ago

hoanguyen94 commented 1 year ago

How did you install the Amplify CLI?

npm install -g @aws-amplify/cli

If applicable, what version of Node.js are you using?

v16.19.0

Amplify CLI Version

10.7.2

What operating system are you using?

Debian

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

Sign in to your AWS administrator account: https://console.aws.amazon.com/ Press Enter to continue 🛑 spawn xdg-open ENOENT

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report' Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Session Identifier: 40a2b1e5-4dd1-4b43-a8b9-c6fc331459a1

Expected behavior

Specify the AWS Region ? region: Specify the username of the new IAM user: ? user name: Complete the user creation using the AWS console:

Reproduction steps

  1. amplify configure

Project Identifier

No response

Log output

``` # Put your logs below this line Sign in to your AWS administrator account: https://console.aws.amazon.com/ Press Enter to continue 🛑 spawn xdg-open ENOENT Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report' Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/ ```

Additional information

I'm running on my local machine

Before submitting, please confirm:

josefaidt commented 1 year ago

Hey @hoanguyen94 :wave: thanks for raising this! This issue appears when using a system that does not have xdg-utils installed. Can you try installing that package and re-running the command?

I will mark this as a bug to consider shipping this dependency along with the CLI

hoanguyen94 commented 1 year ago

Hi @josefaidt , yes I already tried but it didnt work 🤔

josefaidt commented 1 year ago

Hey @hoanguyen94 thanks for clarifying! Can you try restarting your terminal or source-ing your bash/zsh profile for the changes to take effect? Are you able to run which xdg-open?

purvisb179 commented 1 year ago

@josefaidt

I'm having the exact same issue. I'm following this workshop.

I installed xdg-utils via npm and closed the terminal and reopened and the issue persist.

When I run which xdg-open I get this:

/usr/bin/which: no xdg-open in (/home/ec2-user/.rvm/gems/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin:/home/ec2-user/.nvm/versions/node/v16.19.0/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin:/usr/local/bin:/usr/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/home/ec2-user/.rvm/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/home/ec2-user/.rvm/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/home/ec2-user/.rvm/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin)
hoanguyen94 commented 1 year ago

Ah sorry. I also installed it with npm but it didnt actually install. So I tried with apt-get: sudo apt-get update sudo apt-get -y install xdg-utils

And it worked. Thanks :)

purvisb179 commented 1 year ago

Yup i just did sudo yum -y install xdg-utils and that worked.

TomFrost commented 1 year ago

I landed here because I ran into the same issue, but I don't love the suggested resolution. Systems that don't have xdg-utils may have a good reason for not having it -- such as being remote, and headless. I do most of my development on a headless machine over ssh. xdg-utils has a laundry list of hefty dependencies like x11 and gtk that a headless system simply doesn't need, and that I frankly refuse to install and bog down my machine with. Having the amplify CLI detect the lack of xdg-utils and provide a more graceful headless solution would be far better.