安装nodejs

sudo apt-get install nodejs
sudo apt install nodejs-legacy

安装npm

sudo apt install npm

改镜像源

sudo npm config set registry https://registry.npm.taobao.org
sudo npm config list

升级node

sudo npm i -g n
sudo n stable

安装Vue

npm install -g @vue/cli

引入less文件失败

安装less,和less-loader
npm i --save less less-loader

iview自定义主题失败

两个解决方案

  1. less降级为3以下,比如2.7.3
  2. 配置vue.config.js(未实践)

    module.exports = {
    css: { // 配置css模块
    loaderOptions: { // 向预处理器 Loader 传递配置选项
    less: { // 配置less(其他样式解析用法一致)
    javascriptEnabled: true // 设置为true
    }
    }
    }
    }
  3. 报错

    ERROR in ./~/less-loader!./~/autoprefixer-loader!./src/styles/mytheme.less Module parse failed:
    E:\ProjectDemo\vue\IVIEW\node_modules\less-loader\index.js!
    E:\ProjectDemo\vue\IVIEW\node_modules\autoprefixer-loader\index.js
    !E:\ProjectDemo\vue\IVIEW\src\styles\mytheme. less Unexpected token (1:0)
    You may need an appropriate loader to handle this file type. | .ivu-load-loop {
    | animation: ani-load-loop 1s linear infinite; |
    }

修改webpack配置

{
test: /\.less/,
use: ExtractTextPlugin.extract({
use: ['css-loader?minimize', 'autoprefixer-loader', 'less-loader'],
fallback: 'style-loader'
})
},