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.

Syntax Error on eslint --init (ask questions about style) when package.json is malformed

See original GitHub issue

On running eslint --init I get the following error. I’ve tried a few different choices and all result in the same problem. The init phase never succeeds.

$ ./node_modules/eslint/bin/eslint.js --init
? How would you like to configure ESLint? Answer questions about your style
? Are you using ECMAScript 6 features? Yes
? Are you using ES6 modules? Yes
? Where will your code run? Browser
? Do you use CommonJS? Yes
? Do you use JSX? Yes
? Do you use React Yes
? What style of indentation do you use? Spaces
? What quotes do you use for strings? Single
? What line endings do you use? Unix
? Do you require semicolons? Yes
? What format do you want your config file to be in? JavaScript
Unexpected token }
SyntaxError: Unexpected token }
    at Object.parse (native)
    at check (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/lib/util/npm-util.js:76:25)
    at Object.checkDevDeps (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/lib/util/npm-util.js:116:12)
    at installModules (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/lib/config/config-initializer.js:86:29)
    at processAnswers (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/lib/config/config-initializer.js:262:5)
    at null.completed (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/lib/config/config-initializer.js:469:30)
    at PromptUI.onCompletion (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/node_modules/inquirer/lib/ui/prompt.js:57:10)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1550:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1489:14)
    at Subject.Rx.Subject.addProperties.onCompleted (/home/peter/Projects/rikesh-accounting-web/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:5871:19)

What version of ESLint are you using?

$ ./node_modules/eslint/bin/eslint.js -v
$ node -v

What parser (default, Babel-ESLint, etc.) are you using?


Please show your full configuration:


What did you do? Please include the actual source code causing the issue.

See above.

What did you expect to happen?

To successfully create the .eslintrc

What actually happened? Please include the actual, raw output from ESLint.

Syntax Error

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

kaicataldocommented, May 26, 2016

Working on this!

platinumazurecommented, May 26, 2016

I agree we should handle this better. Hope it’s okay if i reopen and retitle the issue. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint not working in VS Code? - Stack Overflow
I have use the command eslint --init to add the basic .eslintrc.json to the main directory of my package. Other people were able...
Read more >
eslint | Yarn - Package Manager
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and...
Read more >
SyntaxError: missing ; before statement - JavaScript | MDN
The JavaScript exception "missing ; before statement" occurs when there is a semicolon ( ; ) missing somewhere and can't be added by...
Read more >
How to fix Unexpected Token in JSON error (for ... - YouTube
Not a programmer? Read this! ** - If you get this error in an app you didn't make, and/or you're not a web...
Read more >
Tags - Lintian - Debian
Lintian ReportsBETA · People · Tags · Screens · Packages · Autoreject · Messages · JSON · Manual · Levels. Tags. Here are...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found