Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common false reports in vuejs?

Shulou Source: shulou.com Published: 2022-06-03 09:53:50 09月11日 Update

This article mainly shows you "what are the common errors in vuejs". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "what are the common errors in vuejs?"

Vuejs common errors are: 1, "vue is not an internal or external command" error; 2, install bootstrap Times "Install fail! Error" error; 3, ESLint syntax error; 4, "es2015" error; 5, use "vue-vli4" Times error error, and so on.

This article operating environment: Windows7 system, vue2.9.6 version, DELL G3 computer.

Summary of Common errors and vue Common errors

1. Vue' is not an internal or external command, nor is it a runnable program or batch file.

Need to install

2. Always report an error when installing bootstrap:

D:\ workspace\ WebstormProjects\ vuejslearn\ duli\ duli1 > cnpm install bootstrap-- save--save-exact × Install fail! Error: [@-- save-exact] resolved target D:\ workspace\ WebstormProjects\ vuejslearn\ duli\ duli1\-- save-exact error: ENOENT: no such file or directory, lstat'D:\ workspace\ WebstormProjects\ vuejslearn\ duli1\-save-exact' Error: [@-save-exact] resolved target D:\ workspace\ WebstormProjects\ vuejslearn\ duli\ duli1\-save-exact error: ENOENT: no such file or directory Lstat'D:\ worksp ace\ WebstormProjects\ vuejslearn\ duli\ duli1\-- save-exact' at module.exports (D:\ soft\ html\ nodejs\ node_modules\ node_global\ node_modules\ cnpm\ node_modules\ npminstall\ lib\ download\ local.js:30:11) at module.exports.throw () at onRejected (D:\ soft\ html\ nodejs\ node_modules\ node_global\ node_modules\ cnpm) npminstall version: 3.22.1

Wait,

The result is that there is an extra space symbol between the save! The right thing to do is to write closely with sava

The 3.ESLint syntax reported an error because different spaces were formatted using the ide editor. The space syntax rules of vue are not recognized. Causing errors to be reported all the time

ESLint: Expected indentation of 2 spaces but found 4. (indent)

Find a lot of ways not, the final solution is: in the .eslintignore file: add a * .vue to cancel the check dve mode can be ignored

4.error in. / src/main.js Module build failed: Error: Couldn't find preset "es2015" reported an error

{

"presets": [["es2015", {"modules": false}]]

"plugins": [

[

"component"

{

"libraryName": "element-ui"

"styleLibraryName": "theme-chalk"

}

]

]

}

Solution.

Execute the following command:

Npm install-save-dev babel-preset-es2015

Success:

5. Error when using vue-vli4: error: Unexpected console statement (no-console)

It is necessary to use ESLint to follow the code specification when writing a project, but it is also very speechless for some specifications, such as: 'Unexpected console statement (no-console)', even console can not be used, which is crazy. In fact, you can add a line of code.

Modify the

"rules" in eslintConfig: {}

Add a line of code: "no-console": "off"

Example:

"no-console": "off"

Reference article: https://www.jianshu.com/p/4f2a6ca1f562

6. Error report: ESLint: Elements in iteration expect to have'v conversation binding directives. (vue/require-v-for-key)

The reason is that bug appears in the eslint test.

There are two solutions.

1. Add: key='item' after v-for

Gender:

{{gender}}

{{gender}}

two。 Turn off eslint detection at build

... (config.dev.useEslint? [createLintingRule ()]: [])

The above is all the contents of the article "what are the common errors in vuejs?" Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Errors constant problems code content commands spaces articles grammar one line methods files methods times learning help detection different no necessary Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux MariaDB Microsoft Shulou Tech Info