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

Sentry wizard fails to install when yarn is not available on host #576

Open
luisitoguanes opened this issue May 31, 2024 · 9 comments
Open

Comments

@luisitoguanes
Copy link

Environment

Wizard Version: 3.22.3
Don't have yarn installed

Steps to Reproduce

  1. run npx @sentry/wizard@latest -i sourcemaps

Expected Result

Installation would be successful

Actual Result

◇ Installation failed.

■ Encountered the following error during installation:

│ Error: Command failed: yarn add @sentry/cli
│ /bin/sh: yarn: command not found

@Lms24
Copy link
Member

Lms24 commented Jun 4, 2024

Hey @luisitoguanes thanks for writing in! Can you share a little bit more context? Which kind of project did you call the source maps wizard in? And just to confirm, would you have expected that npm was called instead of yarn?

Generally, we try to auto detect the package manager by checking for the respective lock files in the project. In case we can't auto-detect lock files, we fall back to npm as the default package manager. I'm not sure why in your case it selected yarn but we'll find it out :)

@luisitoguanes
Copy link
Author

hi @Lms24. Sure, I'm working on a react cra app, using always npm, didn't even have yarn installed.

But, now that you mention this, I do have a yarn.lock file as well (weirdly being updated somehow when I install something using npm 🤷‍♂️) sorry for creating an issue for that 😅

@Lms24
Copy link
Member

Lms24 commented Jun 5, 2024

Ahh that makes sense indeed 😅

No worries! I'll leave this issue open because we should probably give you a way to override the package manager selection. I'm currently thinking of a CLI argument to accomplish this.
Will backlog for now though.

@Lms24
Copy link
Member

Lms24 commented Jun 5, 2024

Just to confirm: are you blocked by this or can you work around the issue for now?

@luisitoguanes
Copy link
Author

I just installed @sentry/cli with npm manually and then run the wizard again. I didn't have any other issue.
Sorry that I didn't put all this on the issue to begin with

@Lms24
Copy link
Member

Lms24 commented Jun 6, 2024

No worries! Just glad you got it working :)

@SteamWind
Copy link

I used the wizard and experienced the same problem. The automatic detection of the package manager should be parameterized or check if a yarn.lock AND a package.json is present.
To fix that, I renamed the yarn.lock temporary (yarn.lock.bak).

@Lms24
Copy link
Member

Lms24 commented Oct 23, 2024

Hey @SteamWind

The automatic detection of the package manager should be parameterized

You mean as in, we should offer something like a --pacman argument to pass in a specific package manager?

check if a yarn.lock AND a package.json is present

Would you mind explaining how you ran into this situation? I'm wondering how could there be a yarn lock without a package.json.

@lforst
Copy link
Member

lforst commented Oct 23, 2024

@Lms24 I think this is more about the situation where a yarn.lock and a package-lock.json or equivalent are present.

I don't think we should add a package manager command line argument. Nobody will ever see it.

My first thought was that we should ask for the package manager when we first try to install and fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

4 participants