錯誤一:vue
當打開項目,輸入npm run dev的時候,會出現這樣的報錯:node
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項目的時候終端報以下報錯:webpack
解決辦法
打開config裏面的index.js
找到
useEslint: trueweb
錯誤二:npm
Module build failed: TypeError: this.getResolve is not a function at Object.loader 安裝node-sass運行報錯sass
解決方法:ui
一、sass-loader的版本太高致使的編譯錯誤,當前最高版本是8.x,須要退回到7.3.1this
運行:spa
npm uninstall sass-loader(卸載當前版本)eslint
npm install sass-loader@7.3.1 --save-dev
二、若是上面的方法不行,或者又產生其餘相關的錯誤,能夠嘗試一下在webpack.base.config.js裏面添加: