Cannot read property ‘version‘ of undefined TypeError Cannot read property ‘version‘ of undefined

Encountered the following error in the VUE project: Cannot read property 'version' of undefined
TypeError: Cannot read property 'version' of undefined at module.exports (/redball_download/node_modules/@vue/cli-plugin-eslint/index.js: 20:27)

As shown in the picture:

insert image description here
This error is an error reported by the code detection tool eslint. The general reason for the above error is that I deleted the eslint configuration in package.json, resulting in a sentence of eslint dependency package. The
corresponding eslint related configuration code is as follows:
"@vue/cli- plugin-eslint": "~4.5.0",
which led to the above error. After I Baidu, I found several articles. The solution is to delete the node_modules of the current project, and then re-npm install to download the dependency package. After I tried it myself, I found that it did
not Then
simply close this annoying eslint. This is really a code detection tool for obsessive-compulsive disorder. Personally, I think it is better to use ctrl+alt+L to standardize the code format, so let me talk about the solution to the above problems first
. Console uninstall eslint: npm uninstall eslint --save After uninstalling, go to the package.json file and delete "@vue/cli-plugin-eslint": "~4.5.0", this code is OK

Then remember to create a project to avoid ESlint in the future
insert image description here

Guess you like

Origin blog.csdn.net/weixin_45932157/article/details/131303819