vue運行出錯(一)


錯誤一:

當打開項目,輸入npm run dev的時候,會出現這樣的報錯:

 1 Errors:
 2   4  http://eslint.org/docs/rules/no-tabs
 3   4  http://eslint.org/docs/rules/indent
 4   1  http://eslint.org/docs/rules/eol-last
 5   1  http://eslint.org/docs/rules/semi
 6   1  http://eslint.org/docs/rules/no-multiple-empty-lines
 7 
 8 
 9   ✘  http://eslint.org/docs/rules/semi    Extra semicolon
10   src\router\index.js:8:16
11   Vue.use(Router);
12                   ^
13 
14   ✘  http://eslint.org/docs/rules/quotes  Strings must use singlequote
15   src\router\index.js:13:13
16         path: "/", component: Main
17                ^
18 
19 
20 ✘ 2 problems (2 errors, 0 warnings)
21 
22 
23 Errors:
24   1  http://eslint.org/docs/rules/quotes
25   1  http://eslint.org/docs/rules/semi
26 
27 You may use special comments to disable some warnings.
28 Use // eslint-disable-next-line to ignore the next line.
29 Use /* eslint-disable */ to ignore all warnings in a file.

運行vue項目的時候終端報如下報錯:

解決辦法
打開config里面的index.js
找到
useEslint: true

 

錯誤二:

Module build failed: TypeError: this.getResolve is not a function at Object.loader 安裝node-sass運行報錯

解決方法:

1、sass-loader的版本過高導致的編譯錯誤,當前最高版本是8.x,需要退回到7.3.1

  運行:

    npm uninstall sass-loader(卸載當前版本)

    npm install sass-loader@7.3.1 --save-dev

2、如果上面的方法不行,或者又產生其他相關的錯誤,可以嘗試一下在webpack.base.config.js里面添加:

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM