zoukankan      html  css  js  c++  java
  • Vue项目style样式层下载less-loader时候遇到的坑

    vue的项目中使用lang=”less“在安装less-loader的时候经常会因为版本过高报错

    Module build failed: TypeError: loaderContext.getResolve is not a function
        at createWebpackLessPlugin (C:UsersEDZDesktop
    sf_enterprise
    sf_enterprise
    ode_modulesless-loaderdistutils.js:31:33)
        at getLessOptions (C:UsersEDZDesktop
    sf_enterprise
    sf_enterprise
    ode_modulesless-loaderdistutils.js:148:31)
        at Object.lessLoader (C:UsersEDZDesktop
    sf_enterprise
    sf_enterprise
    ode_modulesless-loaderdistindex.js:29:49)
    
     @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-3d5f66de","scoped":true,"hasInlineConfig":false}!./node_modules/less-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/order/allOrder.vue 4:14-385 13:3-17:5 14:22-393
     @ ./src/components/order/allOrder.vue
     @ ./src/router/index.js
     @ ./src/main.js
     @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

    通常是因为安装了最新版本的less-loader导致的。只需按照指定版本即可解决

    npm i less-loader@4.1.0

    问题解决好了OK

  • 相关阅读:
    sqlilab less19-less22
    sqlilab less11-less18
    逆向——序列号相关总结
    xctf攻防世界——crackme writeup
    ESP定律脱壳——NsPack3.x脱壳
    避免全局变量漫天飞
    C语言实现队列
    STM32中的C语言知识点
    超时事件时间戳
    STM32-电源控制、低功耗模式
  • 原文地址:https://www.cnblogs.com/mahmud/p/13391595.html
Copyright © 2011-2022 走看看