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

npm run build时报错

E:\Vue\myvue>npm run build


> myvue@1.0.0 build E:\Vue\myvue

> webpack --config webpack.config.js


E:\Vue\myvue\node_modules\webpack-cli\bin\cli.js:244

                                throw err;

                                ^


Error: Cannot find module 'E:\Vue\myvue\webpack.config.js'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)

    at Function.Module._load (internal/modules/cjs/loader.js:506:25)

    at Module.require (internal/modules/cjs/loader.js:636:17)

    at require (E:\Vue\myvue\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)

    at WEBPACK_OPTIONS (E:\Vue\myvue\node_modules\webpack-cli\bin\convert-argv.js:133:13)

    at requireConfig (E:\Vue\myvue\node_modules\webpack-cli\bin\convert-argv.js:135:6)

    at E:\Vue\myvue\node_modules\webpack-cli\bin\convert-argv.js:142:17

    at Array.forEach (<anonymous>)

    at module.exports (E:\Vue\myvue\node_modules\webpack-cli\bin\convert-argv.js:140:15)

    at yargs.parse (E:\Vue\myvue\node_modules\webpack-cli\bin\cli.js:241:39)

    at Object.parse (E:\Vue\myvue\node_modules\yargs\yargs.js:567:18)

    at E:\Vue\myvue\node_modules\webpack-cli\bin\cli.js:219:8

    at Object.<anonymous> (E:\Vue\myvue\node_modules\webpack-cli\bin\cli.js:538:3)

    at Module._compile (internal/modules/cjs/loader.js:688:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

    at Module.load (internal/modules/cjs/loader.js:598:32)

    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)

    at Function.Module._load (internal/modules/cjs/loader.js:529:3)

    at Module.require (internal/modules/cjs/loader.js:636:17)

    at require (internal/modules/cjs/helpers.js:20:18)

    at Object.<anonymous> (E:\Vue\myvue\node_modules\webpack\bin\webpack.js:155:2)

    at Module._compile (internal/modules/cjs/loader.js:688:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

    at Module.load (internal/modules/cjs/loader.js:598:32)

    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)

    at Function.Module._load (internal/modules/cjs/loader.js:529:3)

    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)

    at startup (internal/bootstrap/node.js:285:19)

    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! myvue@1.0.0 build: `webpack --config webpack.config.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the myvue@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!     D:\program files(86)\nodejs\node_cache\_logs\2018-12-11T09_10_17_987Z-debug.log





不知道问题出在哪里

提问者:海婷 2018-12-11 17:40

个回答

  • 慕粉1142317214
    2019-02-15 11:46:36

    上网查了一下是80端口被占用了,但是占用的进程是svchost,不可以结束的,那要怎么解决这个问题啊~~~

  • 慕哥9591630
    2019-01-08 13:11:48

    你发一下你的配置文件

  • 竹影
    2019-01-07 17:04:33

    这个解决了吗, 我也是这个问题...

  • 慕雪4124870
    2018-12-12 18:45:57

    尝试在webpack.config.js配置文件中设置mode属性

    https://img1.mukewang.com/5c10e6be000102ac06200123.jpg