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

Error: Cannot find module 'eslint-config-standard-jsx' from ... #406

Closed
chenxsan opened this issue Feb 6, 2016 · 10 comments

Comments

@chenxsan
Copy link
Member

commented Feb 6, 2016

After updated standard to 6.0.1, I got this error:

screen shot 2016-02-06 at 15 55 56

I tested it on both Mac OSX and Windows 7.

But the module was installed under standard package:

screen shot 2016-02-06 at 16 00 02

I'm not sure what's going on here.

@matjaz

This comment has been minimized.

Copy link

commented Feb 6, 2016

+1
On node 4 I also get this error https://travis-ci.org/matjaz/stdin2/jobs/107404558
On node 5 it looks like a bug Expected parentheses around arrow function argument. https://travis-ci.org/matjaz/stdin2/jobs/107404555

@ungoldman

This comment has been minimized.

Copy link
Member

commented Feb 6, 2016

I can confirm this error locally in node 4.x, 0.12, 0.10. Appears to work fine in 5.x. See https://travis-ci.org/ngoldman/module-init/jobs/107410146 for an example of the error recorded by travis-ci.

Possible causes:

@ungoldman

This comment has been minimized.

Copy link
Member

commented Feb 6, 2016

@matjaz I think it's working fine in node 5 in your case too: https://github.com/matjaz/stdin2/blob/master/test/index.js#L10

This is related to a rule change in standard 6:

Require parens in arrow function arguments
 (#309) (arrow-parens)

@ungoldman

This comment has been minimized.

Copy link
Member

commented Feb 6, 2016

So as far as I can tell this passes in node 5 because 5 is bundled with npm 3, which installs eslint-config-standard-jsx in the root node_modules directory of the project. ESLint looks for the module in the root and everything is fine in that case.

In all non-bleeding-edge cases (npm@2.x), this is not fine, as the errors indicate.

Error: Cannot find module 'eslint-config-standard-jsx' from '/home/travis/build/matjaz/stdin2'
Error: Cannot find module 'eslint-config-standard-jsx' from '/Users/ng/dev/github/module-init'

I'm guessing this is an ESLint rc.0 bug creeping in with the new standard release. The .eslintrc in standard should be able to look for other modules to extend in the node_modules directory relative to its location in the dependency tree first, rather than going straight to the ${process.cwd()}/node_modules directory, failing, then giving up, right? Or something?

@chenxsan

This comment has been minimized.

Copy link
Member Author

commented Feb 6, 2016

@ngoldman I'm using node 5.1.1 with npm 3.6.0.

@z0mt3c

This comment has been minimized.

Copy link

commented Feb 6, 2016

+1

@wraithan

This comment has been minimized.

Copy link

commented Feb 6, 2016

Node 5.5.0, tried with npm@latest and npm@2 both have the same issue. I'll give some other versions a shot if that would be valuable

@watson

This comment has been minimized.

Copy link
Member

commented Feb 6, 2016

This seems to be an issue with version 2 of eslint where it uses process.cwd() to resolve plugins. I think this is also what's being discussed in eslint/eslint#5164.

I've tried to hack the current standard-engine codebase to overwrite the cwd temporarily and this seems to "fix" the problem (here is where it calls eslint)

nknapp pushed a commit to nknapp/thoughtful-release that referenced this issue Feb 6, 2016

Nils Knappmeier
Let TravisCI install standard via pretest script. Use standard@5
- There is an issue with standard@6.0.1 and node 4.2
  standard/standard#406

@feross feross added the bug label Feb 7, 2016

@feross

This comment has been minimized.

Copy link
Member

commented Feb 7, 2016

Sorry about this, everyone. This should be fixed in standard 6.0.3.

Thanks to everyone who helped debug this!

@feross

This comment has been minimized.

Copy link
Member

commented Feb 7, 2016

I've opened an issue on eslint to try to fix the root cause of this issue: eslint/eslint#5175

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
7 participants
You can’t perform that action at this time.