-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
SyntaxError: Unexpected token - } catch { #13838
Comments
Hi @martinoppitz, thanks for the issue. It looks like there's not enough information for us to know how to help you. If you're reporting a bug, please be sure to include:
Requesting a new rule? Please see Proposing a New Rule for instructions. Requesting a rule change? Please see Proposing a Rule Change for instructions. If it's something else, please just provide as much additional information as possible. Thanks! |
Hi :) @martinoppitz |
I'm also getting this error. Here's what I have: bash output: $ npm run lint
> eslint . --ext .js
/Users/user/code/project/node_modules/eslint/bin/eslint.js:93
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1 npm log:
package.json: {
"scripts": {
"lint": "eslint . --ext .js"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.7.0",
"eslint-config-react-app": "^5.2.1",
"eslint-loader": "^3.0.2",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
}
} |
Thanks for the additional info @nguyenj. Node 12.13.0 should support optional |
@btmills I found the issue, a dependency package was causing an issue. Thank you for responding! |
Glad you figured it out @nguyenj. @martinoppitz do you have any more info here? |
Closing for now since at least one case has been resolved and we have no information on the original. @martinoppitz if you have more information for us we'd be happy to take a look! |
Hello @btmills! I was able to reproduce this issue using the latest version of ESLint (v7.14.0) on the demo page. As a result, I think this issue should be reopened (I can also open a new issue if that would be preferred). |
Hi @prototypicalpro, optional |
I also had this issue using SublimeLinter-eslint. I included my finding here SublimeLinter/SublimeLinter-eslint#301 tl;dr sublime may be mapping to the wrong node version, try reinstalling nvm |
This same issue occurred for me when I updated and started using a new nvm node version. Quitting terminal and re-opening stopped the error from occurring anymore, I didn't need to re-install nvm though. |
eslint/bin/eslint.js
Line 93 in 4255f36
The text was updated successfully, but these errors were encountered: