照著打,出現(xiàn)問題 和講的 不一樣什么鬼?
PS D:\項(xiàng)目文件\vue_practice> npm run build
> vue_practice@1.0.0 build D:\項(xiàng)目文件\vue_practice
> 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.
We will use "npm" to install the CLI via "npm install -D".
Do you want to install 'webpack-cli' (yes/no): n
You need to install 'webpack-cli' to use webpack via CLI.
You can also install the CLI manually.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue_practice@1.0.0 build: `webpack --config webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue_practice@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\Mr 宋\AppData\Roaming\npm-cache\_logs\2019-06-04T08_58_12_946Z-debug.log
PS D:\項(xiàng)目文件\vue_practice> npm install -g vur-cli
npm ERR! code E404
npm ERR! 404 Not Found: vur-cli@latest
npm ERR! A complete log of this run can be found in:
npm ERR!? ? ?C:\Users\Mr 宋\AppData\Roaming\npm-cache\_logs\2019-06-04T10_02_42_159Z-debug.log
2019-07-29
你的包安裝有問題,視頻中用的包和webpack比較舊了,有些包現(xiàn)在都被棄用了。
你可以參照webpack4的文檔來(lái)選用官方推薦的包,可以參考我的代碼
我用的是最新版本的webpack4.x,不會(huì)出現(xiàn)安裝報(bào)錯(cuò)的問題。?
https://github.com/carrieguo/vue.js-todolist
2019-06-16
你好,視頻中webapck是3.x的版本,請(qǐng)按視頻中的webpack指定的版本去學(xué)習(xí)。
安裝的時(shí)候指定下版本,比如: npm i webpack@3.10.0
你也可以參考下我整理的源碼:https://github.com/Xiao-Cuir/vue-webpack-todo
這樣能少走一點(diǎn)彎路,希望能幫到你
2019-06-05
可能沒裝webpack-cli吧
在項(xiàng)目根目錄npm -i?webpack-cli。
視頻里是3.0現(xiàn)在從網(wǎng)上下的都4.0,和視頻肯那個(gè)會(huì)有出入