question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

YAMLException: Cannot read config file

See original GitHub issue

Trying to install the eslint shared config from here: https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb

As soon as I add extends: 'airbnb/base' to my .eslintrc, I see this error:

YAMLException: Cannot read config file: /Users/dsernst/Documents/example_repo/node_modules/eslint-config-airbnb/rules/es6.js
Error: end of the stream or a document separator is expected at line 2, column 8:
      'env': {
           ^
Referenced from: airbnb/base
Referenced from: /Users/dsernst/Documents/example_repo/.eslintrc
    at generateError (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:160:10)
    at throwError (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:166:9)
    at readDocument (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:1498:5)
    at loadDocuments (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:1538:5)
    at load (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:1555:19)
    at Object.safeLoad (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:1573:10)
    at readConfigFromFile (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/lib/config.js:121:27)
    at loadConfig (/Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/lib/config.js:172:22)
    at /Users/dsernst/.nvm/versions/node/v4.1.1/lib/node_modules/eslint/lib/config.js:203:46
    at Array.reduceRight (native)

I’m following the standard instructions to install these eslint rules. I’ve gotten this to work in the past… I even have another project open where I’ve been using these shared configs just fine for months.

Tried uninstall and reinstalling, did not help.

I see this relevant issue: https://github.com/eslint/eslint/issues/1443 . Same symptoms, but I am on the latest OS X. Using spaces consistently, no tabs sneaking in anywhere.

Seems very strange. Any idea what’s going on? Is anyone else seeing this?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
arisAlexiscommented, Jan 29, 2016

had the same problem.

if you are using atom, remove “use global eslint”.

0reactions
ljharbcommented, Mar 2, 2016

I’m going to close this for now, then - please feel free to link it to an eslint issue if one is filed

Read more comments on GitHub >

github_iconTop Results From Across the Web

"YAMLException: Cannot read config file: .eslintrc" · Issue #5294
Today I updated from v2.0.0 to eslint v2.1.0 . I have the following .eslintrc (which I have generated using the new --init parameter)...
Read more >
Eslint cannot read config file - Stack Overflow
It looks like this relates to VSCode, the configuration file should be setup with a path to your config. See the guide here....
Read more >
eslint/eslint - Gitter
When I run eslint, it says "YAMLException: cannot read config file ...." and "Error: end of the stream or a document separator is...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
eslint: Fix invalid filename validation - Merge requests - GitLab
This was happening because our ES6 files have the following structure ... match-regex": [2, "^[a-z0-9_]+(\.js)?$"] ^ YAMLException: Cannot read config file: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found