{"action":"closed","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/4455","labels_url":"https://api.github.com/repos/eslint/eslint/issues/4455/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/4455/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/4455/events","html_url":"https://github.com/eslint/eslint/issues/4455","id":117315787,"number":4455,"title":"Cannot read config file .eslintrc when running  /node_modules/.bin/eslint","user":{"login":"doque","id":1480751,"avatar_url":"https://avatars.githubusercontent.com/u/1480751?v=3","gravatar_id":"","url":"https://api.github.com/users/doque","html_url":"https://github.com/doque","followers_url":"https://api.github.com/users/doque/followers","following_url":"https://api.github.com/users/doque/following{/other_user}","gists_url":"https://api.github.com/users/doque/gists{/gist_id}","starred_url":"https://api.github.com/users/doque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doque/subscriptions","organizations_url":"https://api.github.com/users/doque/orgs","repos_url":"https://api.github.com/users/doque/repos","events_url":"https://api.github.com/users/doque/events{/privacy}","received_events_url":"https://api.github.com/users/doque/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/triage","name":"triage","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-17T09:31:30Z","updated_at":"2015-11-17T09:46:20Z","closed_at":"2015-11-17T09:46:20Z","body":"My setup includes a Makefile, which invokes `eslint` like this:\r\n\r\n    NODE_BIN = node_modules/.bin/ \r\n    build-js:\r\n       $(NODE_BIN)eslint /js/*.jsx -c .eslintrc\r\n\r\nThe directory structure (`/project/`) looks like this:\r\n\r\n    /js/\r\n        Foo.jsx\r\n        Bar.jsx\r\n    /node_modules\r\n    Makefile\r\n    .eslintrc    \r\n\r\nWhen running `make build-js` from within , the `.eslintrc` seems to be unavailable:\r\n\r\n    node_modules/.bin/eslint js/*.jsx -c .eslintrc,\r\n    project/node_modules/eslint/lib/config.js:128\r\n                    throw e;\r\n                    ^\r\n\r\n    Error: Cannot read config file: /project/.eslintrc,\r\n    Error: ENOENT: no such file or directory, open '/project/.eslintrc,'\r\n        at Error (native)\r\n        at Object.fs.openSync (fs.js:549:18)\r\n        at Object.fs.readFileSync (fs.js:397:15)\r\n        at readConfigFromFile (/project/node_modules/eslint/lib/config.js:124:57)\r\n        at loadConfig (/project/node_modules/eslint/lib/config.js:176:22)\r\n        at new Config (/project/node_modules/eslint/lib/config.js:387:38)\r\n        at CLIEngine.executeOnFiles (/project/node_modules/eslint/lib/cli-engine.js:528:28)\r\n        at Object.cli.execute (/project/node_modules/eslint/lib/cli.js:161:95)\r\n        at Object.<anonymous> (/project/node_modules/eslint/bin/eslint.js:61:20)\r\n        at Module._compile (module.js:435:26)\r\n    make: *** [build-js] Error 1\r\n\r\nHowever, simply running `cat /project/.eslintrc` (from within `/project/`) correctly shows the contents of `.eslintrc`. The same error occurs when providing the absolute path for `.eslintrc` in the Makefile, such as:\r\n\r\n    build-js:\r\n       $(NODE_BIN)eslint /js/*.jsx -c /long/path/project/.eslintrc\r\n\r\n\r\nI have `eslint` installed globally (**not** using a `~/.eslintrc`), but other developers do not. Our setup depends on running eslint from within `node_modules`. Passing all eslint options via command line is not practical either.\r\n\r\nVersion is `1.9.0`.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28311639-cannot-read-config-file-eslintrc-when-executed-from-within-node_modules?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}