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

fix(js): fix yarn setup to work with yarn3 #17716

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

FrozenPandaz
Copy link
Collaborator

Current Behavior

An error is thrown if using the verdaccio executor with yarn 3

~/p/nx (master|✔) $ pnpm local-registry

> @nx/nx-source@ local-registry /home/jason/projects/nx
> nx local-registry @nx/nx-source


> nx run @nx/nx-source:local-registry

Cleared local registry storage folder /home/jason/projects/nx/build/local-registry/storage
Set npm registry to http://localhost:4873/
 >  NX   Failed to set yarn registry to http://localhost:4873/: Command failed: yarn config get registry
   Pass --verbose to see the stacktrace.

Expected Behavior

The verdaccio executor works with yarn 3

Related Issue(s)

Fixes #

@FrozenPandaz FrozenPandaz requested a review from a team as a code owner June 21, 2023 20:40
@nx-cloud
Copy link

nx-cloud bot commented Jun 21, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit a7ad5b4. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Jun 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2023 1:49pm

} catch (e) {
return () => {};
}
const yarnV1 = major(execSync('yarn --version').toString().trim()) === 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this isYarnV1 instead or something similar?


if (!yarnV1) {
execSync(
`yarn config set unsafeHttpWhitelist --json '["localhost"]'` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will overwrite the existing value and we don't have a stored value to set it back to, potentially breaking folks.

: ''
);
logger.info(
`Whitelist http://localhost:${options.port}/ as an unsafe http server`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Whitelist http://localhost:${options.port}/ as an unsafe http server`
`Whitelisted http://localhost:${options.port}/ as an unsafe http server`

@FrozenPandaz FrozenPandaz changed the title chore(js): fix yarn setup to work with yarn3 fix(js): fix yarn setup to work with yarn3 Jun 22, 2023
@FrozenPandaz FrozenPandaz requested a review from AgentEnder June 22, 2023 13:52
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants