vuxui 安装使用,解决npm项目文件严重问题提示

vuxui 的安装使用,解决npm项目文件严重问题提示

同时解决found 11 vulnerabilities (1 low, 9 moderate, 1 high) 提示。

初始化vue项目.

cd myproject
vue init -y

手动安装

 npm install webpack webpack-dev-server babel-core babel-loader babel-preset-es2015 babel-preset-stage-0 css-loader style-loader less less-loader file-loader url-loader html-webpack-plugin --save-dev

用vue-cli 配置项目

vue init webpack  projectname
cd projectname
npm install  --save-dev vuex axios element-ui

用 vux 配置项目

 npm install vue-cli -g # 如果还没安装
 vue init airyland/vux2 projectPath

 cd projectPath
 npm install --registry=https://registry.npm.taobao.org

cnpm install 或者 yarn

 npm run dev 

##或者

yarn dev

如果有下面的错误

  • found 11 vulnerabilities (1 low, 9 moderate, 1 high) in 11397 scanned packages ## 运行npm audit修复 ## 若有 # Run npm install --save-dev [email protected] to resolve 4 vulnerabilities 提示 ## 运行
  • npm install --save-dev [email protected]

打开package.json 删除 less-loader

  • 再用npm install less-loader,使版本与less匹配。

若有 # Run npm install --save-dev [email protected] to resolve 1 vulnerability 提示

运行

npm install --save-dev [email protected] 

若有 Run npm install --save-dev [email protected] to resolve 2 vulnerabilities SEMVER WARNING: Recommended action is a potentially breaking change 提示

删除package.json带webpack的项,运行

npm install --save-dev webpack webpack-dev-server webpack-bundle-analyzer webpack-dev-middleware webpack-dev-server webpack-hot-middleware webpack-merge

npm install --save-dev vue-loader@14  webpack-cli copy-webpack-plugin extract-text-webpack-plugin html-webpack-plugin friendly-errors-webpack-plugin optimize-css-assets-webpack-plugin

如果还有问题

npm install -g npm-check-updates

或者

 cnpm install -g npm-check-updates

查看更新

ncu 
  • 然后按提示升级版本
  • ncu 是 npm-check-updates 的缩写命令
  • vue-loader@15需要的配置不一样,指定为@14版。

关于 webpack4+的问题

修改package.json

 "build": "webpack --mode production

如果出现下面的错误

  • ERROR in Entry module not found: Error: Can't resolve './src' in 'D:\webfront-project\isi'
  • 是因为找不到配置文件导致,修改package.json,加上--config 
    "build": "webpack --mode production --config build/webpack.prod.conf"

     

下列带removed的问题找到相关内容删掉:

  • Error: webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead.
  • Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead. 
    npm install extract-text-webpack-plugin@next

     

你可能感兴趣的:(互联网,html,css)