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

/node_modules/lint-staged/bin/lint-staged.js:96 } catch { ^ SyntaxError: Unexpected token { #1286

Open
sharryling opened this issue Apr 19, 2023 · 3 comments

Comments

@sharryling
Copy link

sharryling commented Apr 19, 2023

I have tryed to reinstall node_module, and enter the command line, npm cache clear --force, and also changed my node version,like v10.24.1/12.22.12/14.21.3/16.19.0, and they didn't work.

image

In addiction, when I entered npm run lint, it runned with no error.

package.json
{
"dependencies": {
"@gf/wealth-ui": "0.3.65",
"@vue/cli": "3.9.2",
"axios": "0.17.1",
"babel-polyfill": "6.26.0",
"clipboard": "2.0.8",
"countup.js": "2.0.7",
"custom-event-polyfill": "0.3.0",
"echarts": "4.0.1",
"element-ui": "2.0.7",
"html2canvas": "1.0.0-rc.7",
"ie9-oninput-polyfill": "1.1.1",
"lodash": "4.17.10",
"lodash.debounce": "4.0.8",
"lodash.throttle": "4.1.1",
"lottie-web": "5.7.1",
"moment": "2.19.4",
"moment-timezone": "0.5.31",
"sa-sdk-javascript": "1.10.3",
"vue": "2.5.9",
"vue-cropper": "0.5.5",
"vue-router": "3.0.1",
"vue-ueditor-wrap": "2.4.4",
"vuex": "3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "3.9.2",
"@vue/cli-plugin-eslint": "3.9.2",
"@vue/cli-plugin-unit-jest": "3.9.0",
"@vue/cli-service": "3.9.2",
"@vue/eslint-config-standard": "4.0.0",
"@vue/test-utils": "1.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.0",
"cross-env": "7.0.3",
"eslint": "5.8.0",
"eslint-plugin-vue": "5.0.0",
"lint-staged": "10.5.4",
"package-icons": "0.0.7",
"raw-loader": "2.0.0",
"sass": "1.20.1",
"sass-loader": "7.1.0",
"shelljs": "0.8.3",
"svg-sprite-loader": "3.9.2",
"svgo": "1.2.0",
"svgo-loader": "2.2.0",
"vue-template-compiler": "2.5.9",
"worker-loader": "2.0.0"
},
"engines": {
"node": ">= 8.0.0",
"npm": ">= 5.0.0"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,vue}": "vue-cli-service lint"
}

I work with MacBook with M2 chip.

@iiroj
Copy link
Member

iiroj commented Apr 20, 2023

What Node.js version are you using? The support for "optional catch binding" has been added in Node.js 10, and we require at least Node.js 14.13.1:

https://github.com/okonet/lint-staged/blob/e7ed6f741d2ea0f084b06f3e1ac3d1d57fadf737/package.json#L17

@sharryling
Copy link
Author

What Node.js version are you using? The support for "optional catch binding" has been added in Node.js 10, and we require at least Node.js 14.13.1:

https://github.com/okonet/lint-staged/blob/e7ed6f741d2ea0f084b06f3e1ac3d1d57fadf737/package.json#L17

I haved changed some node.js version like 10.24.1/12.22.12/14.21.3/16.19.0, and got the same error message.

@sharryling
Copy link
Author

Otherwise, others using other computed, with node.js 10.24.1, didn't get the error message.

And the error happens :
image

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

No branches or pull requests

2 participants