慕九州niubi
2019-06-05 10:33
PS D:\项目文件\vue_practice> npm run build
> vue_practice@1.0.0 build D:\项目文件\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:\项目文件\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
你的包安装有问题,视频中用的包和webpack比较旧了,有些包现在都被弃用了。
你可以参照webpack4的文档来选用官方推荐的包,可以参考我的代码
你好,视频中webapck是3.x的版本,请按视频中的webpack指定的版本去学习。
安装的时候指定下版本,比如: npm i webpack@3.10.0
你也可以参考下我整理的源码:https://github.com/Xiao-Cuir/vue-webpack-todo
这样能少走一点弯路,希望能帮到你
可能没装webpack-cli吧
在项目根目录npm -i webpack-cli。
视频里是3.0现在从网上下的都4.0,和视频肯那个会有出入
Vue+Webpack打造todo应用
84606 学习 · 787 问题
相似问题