为了账号安全,请及时绑定邮箱和手机立即绑定

npm run build 错误

> tudolist-vue2.0@1.0.0 build C:\Users\Administrator\Desktop\learn\code\tudolist-vue2.0

> webpack --config webpack.config.js

Insufficient number of arguments or no entry found.

Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: 2fec1d82e4d44391aee7

Version: webpack 4.12.0

Time: 101ms

Built at: 2018-06-22 14:39:20

WARNING in configuration

The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.

You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

ERROR in Entry module not found: Error: Can't resolve 'C:\Users\Administrator\Desktop\learn\code\tudolist-vue2.0\src\index.js' in 'C:\Users\Administrator\Desktop\learn\code\tudolist-vue2.0'

npm ERR! code ELIFECYCLE

npm ERR! errno 2

npm ERR! tudolist-vue2.0@1.0.0 build: `webpack --config webpack.config.js`

npm ERR! Exit status 2

npm ERR!

npm ERR! Failed at the tudolist-vue2.0@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\Administrator\AppData\Roaming\npm-cache\_logs\2018-06-22T06_39_21_001Z-debug.log


正在回答

5 回答

入口文件引入错误

0 回复 有任何疑惑可以回复我~

webpack.dev.js文件中path: path.resolve(__dirname, 'dist'),重新设置下,注意dirname前边的下划线

0 回复 有任何疑惑可以回复我~

这个是webpack版本的问题么,遇到这个不知道咋解决

0 回复 有任何疑惑可以回复我~

请问这个问题解决了吗?我也是一样的问题。。

0 回复 有任何疑惑可以回复我~

webpack4.0 往后的版本的webpack 启动命令需要加上mode参数 指定是生产环境还是开发环境

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Vue+Webpack打造todo应用
  • 参与学习       84606    人
  • 解答问题       787    个

用前端最热门框架Vue+最火打包工具Webpack打造todo应用

进入课程

npm run build 错误

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信