webpack4 使用webpack-merge问题
跟着老师敲得代码,由于老师用的是webpack3 我用的是4,用这个插件出现了问题,经过百度,给出的解决方案 是降级,但并不想降级,请问有什么解决方案吗
Error: Cannot find module 'C:\Users\QingChen\Desktop\VueTest\build\prod.config.js'
Require stack:
- C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\utils\convert-argv.js
- C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\cli.js
- C:\Users\QingChen\Desktop\VueTest\node_modules\webpack\bin\webpack.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
at Function.Module._load (internal/modules/cjs/loader.js:677:27)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (C:\Users\QingChen\Desktop\VueTest\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at WEBPACK_OPTIONS (C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\cli.js:71:45
at Object.parse (C:\Users\QingChen\Desktop\VueTest\node_modules\yargs\yargs.js:567:18)
at C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\cli.js:49:8
at Object.<anonymous> (C:\Users\QingChen\Desktop\VueTest\node_modules\webpack-cli\bin\cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object.<anonymous> (C:\Users\QingChen\Desktop\VueTest\node_modules\webpack\bin\webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\QingChen\\Desktop\\VueTest\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
'C:\\Users\\QingChen\\Desktop\\VueTest\\node_modules\\webpack-cli\\bin\\cli.js',
'C:\\Users\\QingChen\\Desktop\\VueTest\\node_modules\\webpack\\bin\\webpack.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vuetest@1.0.0 build: `webpack --config ./build/prod.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vuetest@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\QingChen\AppData\Roaming\npm-cache\_logs\2019-10-02T14_44_23_422Z-debug.log
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
刚看了下
我这边使用的是这个版本是没有问题的,你具体的版本号是多少