npm run build失败
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-loader-webpack@1.0.0 build: `webpack --config webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-loader-webpack@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lianghuiling\AppData\Roaming\npm-cache\_logs\2018-05-24T12_38_35_039Z-debug.log
errno 1 我也遇到过,这个课程是webpack3.0的,你练习应该是用的4.0,需要加webpack-cli依赖
这个要怎么指定环境啊大佬们 网上找的试了都不行
这个最后解决没有,是怎么解决的,急求
webpack用的新版
"webpack": "^4.9.1"
同时还要添加这个依赖
"webpack-cli": "^2.1.4"
然后配置文件如下写 即可正常build
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
entry: path.join(__dirname, 'src/index.js'),
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'dist')
},
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.css$/,
use: [
'css-loader'
]
}]
},
plugins: [
new VueLoaderPlugin()
]
}兄弟,你解决了吗,我找了好半天资料都没人解决啊
需要先在package.json中进行配置先 ,才可以进行使用
"<scripts>":{
"build":"webpack --config webpack.config.js"
}