啟動(dòng)
嘗試性解決方法
node及依賴(lài)包
1、有可能是node版本的問(wèn)題,可以安裝高一點(diǎn)的版本肖抱,若項(xiàng)目有要求,可能要安裝低一點(diǎn)的版本
2异旧、將依賴(lài)包刪掉重新安裝
3意述、需要cnpm安裝的依賴(lài)使用了npm安裝,問(wèn)清楚使用什么安裝泽艘。
報(bào)錯(cuò)
1欲险、iView配置主題時(shí)報(bào)錯(cuò)
// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
build-utils
less: generateLoaders('less', { javascriptEnabled: true }),
2镐依、Syntax Error: Unexpected token
webpack沒(méi)處理es6的語(yǔ)法匹涮,安裝配置babel
打包
1、Cannot read property 'compilation' of undefined
(last-call-webpack-plugin)
原因是package.json 中的一些包版本過(guò)高槐壳,而node的版本太低然低,版本對(duì)應(yīng)不上導(dǎo)致出錯(cuò)。(我同事用的10版本的node务唐,install完依賴(lài)后雳攘,依賴(lài)的版本變高,我用的8版本的node)
解決辦法:將版本降低
npm i optimize-css-assets-webpack-plugin@3 -D
2枫笛、ERROR in xxx.js from UglifyJs
原因:webpack在打包vue文件時(shí)沒(méi)有成功轉(zhuǎn)換ES6的語(yǔ)法
解決:
1> 安裝依賴(lài)
npm install --save-div babel-preset-es2015
2> webpack.config.js
{
test: /\.js$/,
use: [{
loader: 'babel-loader',
options: {
presets: ['es2015']
}
}]
}
3>根目錄下添加【.babelrc】文件,內(nèi)容如下
{
"presets": ["es2015"]
}
上線(xiàn)
1吨灭、Loading chunk 10 failed. at HTMLScriptElement.i
路由不能跳轉(zhuǎn)
解決方式:
config - index.js
assetsPublicPath: '/', // 需要設(shè)置為此
vue
1、You may have an infinite update loop in a component render function.
1>升級(jí)vue到最高版本 :npm update vue -s
2-1> 執(zhí)行npm uninstall vue-template-compiler
2-2> 執(zhí)行npm install vue-template-compiler@報(bào)錯(cuò)中提示的vue的版本號(hào)