react-stripe-elements icon indicating copy to clipboard operation
react-stripe-elements copied to clipboard

Linting script throws error about missing dependencies

Open indiesquidge opened this issue 9 years ago • 6 comments

Installing this project and running yarn lint throws Error: Cannot find module 'eslint-config-airbnb-base', which is dependency on the eslint-config-stripe package.

screen shot 2017-09-21 at 12 42 20 pm

Installing each dependency the script throws an error on (eslint-config-airbnb-base, eslint-plugin-import, eslint-plugin-jsx-a11y, and eslint-plugin-react) eventually leads to the script running properly, but including all of the plugins and configs here is not the best solution.

Perhaps this is an issue that needs to be opened on the eslint-config-stripe package itself, but I wasn't totally sure how to test out any changes I made without applying it to a project, so I figured using this repository as a guinea pig was alright.

tl;dr – eslint-config-stripe is throwing some errors, which is disabling me from running the lint script locally; installing the config and plugin dependencies works, but I don't know if that's the proper solution for this issue.

indiesquidge avatar Sep 21 '17 19:09 indiesquidge

Hm, I just tried these commands:

mkdir ~/foo
cd ~/foo
git clone https://github.com/stripe/react-stripe-elements
cd react-stripe-elements
yarn install
yarn lint

And it worked fine. Double checking, there does appear to be a folder at ~/foo/react-stripe-elements/eslint-config-airbnb-base, so presumably it's correctly installing and using the local module.

To double check this, I ran these commands:

npm list -g
yarn global list

to see which modules I have installed globally, and eslint-config-airbnb-base doesn't show up in either list.

I think this likely a problem with your dev setup. Maybe try starting from as clean a slate you can, and run the commands I linked above (starting from mkdir ~/foo)? Otherwise, I'm at a loss for how to proceed.

jez-stripe avatar Sep 21 '17 20:09 jez-stripe

This issue was opened with a fresh clone of this repository, but just to be sure, I did another clone to a ~/foo folder like you suggest.

Double checking, there does appear to be a folder at ~/foo/react-stripe-elements/eslint-config-airbnb-base, so presumably it's correctly installing and using the local module.

I presume you meant to say there was a folder at ~/foo/react-stripe-elements/node_modules/eslint-config-airbnb-base? I still don't see this after installing

screen shot 2017-09-21 at 3 29 21 pm

I think this likely a problem with your dev setup.

Perhaps. But then why is the lint script failing even when I manually run the commands with the node_modules binary? This is confusing to me. The only other thing I can think of is that my yarn version is causing this issue.

What version of yarn are you currently using? I am on v1.0.2, which is a very recent release.

indiesquidge avatar Sep 21 '17 22:09 indiesquidge

This indeed appears to be an issue of my yarn version. Downgrading to v.0.24.4, I was able to run the linting script just fine. I'm curious what might be causing v1.0.2 to miss installing dependencies of dependencies here. I tried looking through their issue log, but it's a bit daunting and hard to know which open issues (if any) relate to this specific problem.

Either way, the problem is with yarn, and not this package. I'll keep on a more stable and less bleeding-edge version of Yarn for the time being in order to avoid confusing problems like this one.

indiesquidge avatar Sep 21 '17 22:09 indiesquidge

Oh huh, looks like we're using 0.27.5 here at Stripe.

Thanks for bringing this to our attention! I've added it to our internal issue tracker to investigate upgrading / supporting yarn 1.0.

jez-stripe avatar Sep 22 '17 01:09 jez-stripe

I just re-tested these steps on yarn v1.2.1 and I think the issue should be fixed.

@indiesquidge If you end up upgrading yarn, let me know if you still see this issue!

jez avatar Oct 24 '17 00:10 jez

@jez, seems to work fine now, thanks!

indiesquidge avatar Jan 14 '18 00:01 indiesquidge