问答详情
源自:2-1 vue-loader+webpack项目配置

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


提问者:慕婉清6814092 2018-06-22 14:42

个回答

  • 土土的星
    2019-04-29 02:44:48

    入口文件引入错误

  • 雪落无痕588
    2018-08-20 14:17:33

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

  • 慕粉3315391
    2018-07-10 14:51:53

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

  • 靜哥哥呀
    2018-07-06 20:30:41

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

  • qq_北冥有余_04199370
    2018-06-24 12:34:32

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