简体   繁体   中英

ESLint/Prettier throw errors after node upgrade

I am currently using ESLint and Prettier to lint my React project. This is currently using node version 10. When running the lint command, no errors were given

I have recently upgraded to version 12 without upgrading any other package. I now get linting errors

Does ESLint/Prettier rules/errors differ based on the node version?

You can reinstall linters, formatters in your project with the compatible ones. First copy their name from package.json . After uninstall them with yarn or npm command. After removing all the linters, formatters in your package.json.


rm -fr node_modules/ package-lock.json

npm cache clean --force

# install the packages you have removed
npm i package1 package2 package3 --unsafe-perm

# install other dependencies 
npm i --unsafe-perm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM