運行 npm run build時報錯
> [email protected] build E:\work\todoList
> webpack --config webpack.config.js
One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
?- webpack-cli (https://github.com/webpack/webpack-cli)
? ?The original webpack full-featured CLI.
?- webpack-command (https://github.com/webpack-contrib/webpack-command)
? ?A lightweight, opinionated webpack CLI.
We will use "npm" to install the CLI via "npm install -D".
Which one do you like to install (webpack-cli/webpack-command):
One CLI needs to be installed alongside webpack to use the CLI.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack --config webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\Tom\AppData\Roaming\npm-cache\_logs\2018-06-01T07_54_45_313Z-debug.log
2018-06-01
Which one do you like to install (webpack-cli/webpack-command):
提示輸入時,輸出webpack-cli即可
2019-09-23
樓主,解決了嗎,可以分享下嘛
2019-09-23
解決了嗎
2019-03-01
以上兩個方法都試過了,沒用
2019-01-07
在webpack.config.js文件添加
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
????//里面添加:
????plugins: [
????????new VueLoaderPlugin()
????]
}
這樣就不會報錯了
2018-11-23
那個都沒有起效
2018-06-28
webpack-cli和webpack-commond 選一個
2018-06-05
輸入npm install webpack-cli -g或者npm install?webpack-commond -g即可,必須加-g ,也就是全局安裝,否則不行