我在一个Vue/Vuetify项目上工作了很长一段时间.直到昨天一切都很顺利.我在使用<v-simple-table> vuetify组件时遇到了问题,所以我决定运行npm安装并重新安装vuetify:坏主意.

问题是,在运行npm run serve时,我多次出现以下错误:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
ValidationError: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'indentedSyntax'. These properties are valid:
   object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }
    at validate (C:\Users\Jeroen\Documents\favourite_xi\node_modules\sass-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\Jeroen\Documents\favourite_xi\node_modules\sass-loader\dist\index.js:36:28)

 @ ./node_modules/vuetify/src/components/VCalendar/mixins/calendar-with-events.sass 4:14-225 14:3-18:5 15:22-233
 @ ./node_modules/vuetify/lib/components/VCalendar/mixins/calendar-with-events.js
 @ ./node_modules/vuetify/lib/components/VCalendar/VCalendar.js
 @ ./node_modules/vuetify/lib/components/VCalendar/index.js
 @ ./node_modules/vuetify/lib/components/index.js
 @ ./node_modules/vuetify/lib/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.178.115:8080/sockjs-node ./node_modules/@vue/cli-service/node_modules/webpack/hot/dev-server.js ./src/main.js

我的主菜.js文件:

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import Vuetify from 'vuetify/lib'
import 'vuetify/dist/vuetify.min.css'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

Vue.use(BootstrapVue)
Vue.use(Vuetify, {
  theme: {
    "primary": "#FFCA28",
    "secondary": "#1976D2",
    "accent": "#82B1FF",
    "error": "#FF5252",
    "info": "#2196F3",
    "success": "#4CAF50",
    "warning": "#FB8C00"
  }
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

我已经看过多篇帖子,它们都建议运行npm rebuild node-sass(都是在管理模式下定期运行),删除node modules文件夹,重新安装sass loader,但到目前为止没有任何效果.

我的主要问题是什么.也许吧?

提前谢谢!如果我需要发布更多代码或其他信息,请告诉我.

编辑:添加包.json

{
  "name": "favourite_xi",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "bootstrap": "^4.3.1",
    "bootstrap-vue": "^2.0.0-rc.22",
    "core-js": "^2.6.5",
    "node-sass": "^4.12.0",
    "stylus": "^0.54.7",
    "stylus-loader": "^3.0.2",
    "uuid": "^3.3.3",
    "vue": "^2.6.10",
    "vue-cool-select": "^2.10.2",
    "vue-flip": "^0.3.0",
    "vue-responsive-text": "^0.1.4",
    "vue-router": "^3.0.3",
    "vuetify": "^2.0.16",
    "vuex": "^3.1.1"
  },
  "devDependencies": {
    "@fortawesome/fontawesome-free": "^5.10.1",
    "@vue/cli-plugin-babel": "^3.8.0",
    "@vue/cli-plugin-eslint": "^3.8.0",
    "@vue/cli-service": "^3.8.0",
    "@vue/eslint-config-standard": "^4.0.0",
    "babel-eslint": "^10.0.1",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "sass-loader": "^8.0.0",
    "vue-template-compiler": "^2.6.10",
    "webpack": "^4.39.3"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "@vue/standard"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}

推荐答案

这可能是从v7升级到sass-loader的结果.从x到v8.十、

release notes所述,他们对配置进行了重大更改

判断你的vue.config.js-如果你发现类似的情况:

module.exports = {
  css: {
    loaderOptions: {
      sass: {
        ....some options here...
      }
    }
  }
}

将其更改为:

module.exports = {
  css: {
    loaderOptions: {
      sass: {
        sassOptions: {
          ....some options here...
        }
      }
    }
  }
}

Vue.js相关问答推荐

从组件中检索 Shopware CMS 编辑器中的自定义实体数据

Vue.js 和观察者模式

如何在 Nativescript 应用程序中调用 axios/api 调用

将props传递给设置时的VueJS 3组合API和TypeScript类型问题:类型上不存在属性 user用户

在keyup Vuejs 2上获取输入值

在 Vue.js 中动态挂载单个文件组件

作用域slots和 IE11 的问题

Bootstrap-vue b-table,标题中带有过滤器

在组件的样式部分使用 Vue 变量

VueJS + Typescript:类型上不存在属性

vuejs挂载生命周期未触发

Vuex - 何时从 http 服务器加载/初始化存储数据

Vuejs 3 从子组件向父组件发出事件

如何使用 JavaScript 按索引删除数组元素?

我如何能够在 vue js html 中以给定格式进行多项 Select 和传递数据?

使用 axios 和 vue.js 取消先前的请求

Vue 3 – 渲染无法动画的非元素根 node

如何在 Vue 数据对象中运行函数?

如何修复套接字 io 中的 400 错误错误请求?

如何订阅store 模块