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

Docs: Provide install commands for Yarn #13661

Merged
merged 1 commit into from Sep 12, 2020

Conversation

nbaksalyar
Copy link
Contributor

@nbaksalyar nbaksalyar commented Sep 6, 2020

npx doesn't work properly with plugins installed with Yarn.

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

  • Documentation update

What changes did you make? (Give an overview)

The installation guide might be slightly confusing for new users - e.g.: I use TypeScript in my project, I install eslint with yarn as the guide says, and then run it with npx eslint --init. It then fails with an error because the TypeScript plugin has been installed with yarn and npx doesn't see it:

Error: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.js': Cannot find module 'eslint'

This can be fixed by using yarn run <cmd> instead of npx <cmd>. This PR changes documentation to reflect this.

npx doesn't work properly with plugins installed with Yarn.
@jsf-clabot
Copy link

jsf-clabot commented Sep 6, 2020

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Sep 6, 2020
@btmills btmills added documentation Relates to ESLint's documentation and removed triage An ESLint team member will look at this issue soon labels Sep 7, 2020
Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

Thanks for contributing, @nbaksalyar!

npx doesn't work properly with plugins installed with Yarn.

I didn't know that, but that's annoying. Is that because of the installation changes in Yarn v2? (I tried it with Yarn v1 and didn't have any issues.) Either way, LGTM because I'm fine with having both npm/npx and yarn commands for consistency.

@nbaksalyar
Copy link
Contributor Author

Is that because of the installation changes in Yarn v2?

I think so! I use the berry (v2.2) version for Yarn.

Thanks for reviewing :)

@kaicataldo kaicataldo merged commit f1d07f1 into eslint:master Sep 12, 2020
@kaicataldo
Copy link
Member

Thanks for contributing!

@nbaksalyar nbaksalyar deleted the fix-installation-guide branch September 12, 2020 18:26
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 18, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants