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

Failing to load eslint #57

Open
rplopes opened this issue Nov 30, 2015 · 5 comments
Open

Failing to load eslint #57

rplopes opened this issue Nov 30, 2015 · 5 comments

Comments

@rplopes
Copy link

rplopes commented Nov 30, 2015

We've been using check-build to run jscs and jshint. We now wanted to add eslint, but check-build fails to load it (running eslint separately works fine).

Simplified package.json:

{
  ...
  "devDependencies": {
    "check-build": "2.6.0",
    "eslint": "1.10.2",
    "jscs": "1.13.1",
    "jshint": "2.8.0",
    ...
  },
  ...
}

Our .checkbuild after adding eslint:

{
  "checkbuild": {
    "enable": ["eslint", "jscs", "jshint"],
    "allowFailures": false,
    "continueOnError": true
  },
  "eslint": {
    "args": ["."]
  },
  "jscs": {
    "args": ["."]
  },
  "jshint": {
    "args": ["."]
  },
}

Running eslint independently works:

$ eslint .
$ echo $?
0

However, check-build fails on eslint:

$ check-build
[eslint]

/bin/sh: <project_dir>/node_modules/check-build/node_modules/.bin/eslint: No such file or directory


Checkbuild module "eslint" failed.

true

[jscs]
No code style errors found.

[jshint]

✔ No problems


1 module(s) failed, exiting.

I don't fully understand if this is an issue with check-build looking for eslint in the wrong directory (if it was meant to use <project_dir>/node_modules/.bin/eslint instead, which exists) or looking at the right directory but for some reason not being shipped with the necessary bin.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28717323-failing-to-load-eslint?utm_campaign=plugin&utm_content=tracker%2F7304231&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F7304231&utm_medium=issues&utm_source=github).
@FGRibreau
Copy link
Owner

Hello @rplopes, it's linked with the upgrade to npm3, since npm3 flatten node directories I did not came up with a fix right know but I'm looking forward to it

@rplopes
Copy link
Author

rplopes commented Dec 2, 2015

Hi @FGRibreau. Thank you for the reply. However, I'm still using npm 2:

$ npm -v
2.14.7

Is this behaviour to be expected with this version of npm?

@FGRibreau
Copy link
Owner

Is /node_modules/.bin/eslint available ? Did you try to completly remove node_modules and then start an npm install again?

@rplopes
Copy link
Author

rplopes commented Dec 2, 2015

Yes, and running it from the node_modules directory results in the same behaviour as running it as described above:

$ node_modules/.bin/eslint .
$ echo $?
0

Removing the node_modules directory and running npm install again results in the same error: check-build will still try to load eslint from node_modules/check-build/node_modules/.bin/eslint and fail with No such file or directory.

@FGRibreau
Copy link
Owner

We just need to update check-build eslint.js with require.resolve('eslint') to make it work

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

No branches or pull requests

2 participants