当我运行D
时,我收到错误消息。我会得到一个npm run build
文件夹。
dist
我一直都会收到此错误,但我不知道是否由webpack或其他内容决定。在我的ERROR in Error: Child compilation failed:
Entry module not found: Error: Can't resolve '/Users/jurdekker/Desktop/OnWeb/O nWeb.react/Sisketeers/dist/index.html' in '/Users/jurdekker/Desktop/OnWeb/OnWe b.react/Sisketeers':
Error: Can't resolve '/Users/jurdekker/Desktop/OnWeb/OnWeb.react/Sisketeers/di st/index.html' in '/Users/jurdekker/Desktop/OnWeb/OnWeb.react/Sisketeers'
- compiler.js:76
[Sisketeers]/[html-webpack-plugin]/lib/compiler.js:76:16
- Compiler.js:304 compile
[Sisketeers]/[webpack]/lib/Compiler.js:304:11
- Compiler.js:514 applyPluginsAsync.err
[Sisketeers]/[webpack]/lib/Compiler.js:514:14
- Tapable.js:202 next
[Sisketeers]/[tapable]/lib/Tapable.js:202:11
- CachePlugin.js:78 Compiler.<anonymous>
[Sisketeers]/[webpack]/lib/CachePlugin.js:78:5
- Tapable.js:206 Compiler.applyPluginsAsyncSeries
[Sisketeers]/[tapable]/lib/Tapable.js:206:13
- Compiler.js:511 compilation.seal.err
[Sisketeers]/[webpack]/lib/Compiler.js:511:11
- Tapable.js:195 Compilation.applyPluginsAsyncSeries
[Sisketeers]/[tapable]/lib/Tapable.js:195:46
- Compilation.js:671 self.applyPluginsAsync.err
[Sisketeers]/[webpack]/lib/Compilation.js:671:19
- Tapable.js:195 Compilation.applyPluginsAsyncSeries
[Sisketeers]/[tapable]/lib/Tapable.js:195:46
- Compilation.js:662 self.applyPluginsAsync.err
[Sisketeers]/[webpack]/lib/Compilation.js:662:11
- Tapable.js:195 Compilation.applyPluginsAsyncSeries
[Sisketeers]/[tapable]/lib/Tapable.js:195:46
- Compilation.js:657 self.applyPluginsAsync.err
[Sisketeers]/[webpack]/lib/Compilation.js:657:10
- Tapable.js:195 Compilation.applyPluginsAsyncSeries
[Sisketeers]/[tapable]/lib/Tapable.js:195:46
- Compilation.js:653 sealPart2
[Sisketeers]/[webpack]/lib/Compilation.js:653:9
- Tapable.js:195 Compilation.applyPluginsAsyncSeries
[Sisketeers]/[tapable]/lib/Tapable.js:195:46
- Compilation.js:596 Compilation.seal
[Sisketeers]/[webpack]/lib/Compilation.js:596:8
- Compiler.js:508 applyPluginsParallel.err
[Sisketeers]/[webpack]/lib/Compiler.js:508:17
- Tapable.js:289
[Sisketeers]/[tapable]/lib/Tapable.js:289:11
- Compilation.js:498 _addModuleChain
[Sisketeers]/[webpack]/lib/Compilation.js:498:11
- Compilation.js:381 errorAndCallback.bail
[Sisketeers]/[webpack]/lib/Compilation.js:381:4
- Compilation.js:404 moduleFactory.create
[Sisketeers]/[webpack]/lib/Compilation.js:404:13
- NormalModuleFactory.js:235 factory
[Sisketeers]/[webpack]/lib/NormalModuleFactory.js:235:20
- NormalModuleFactory.js:60 resolver
[Sisketeers]/[webpack]/lib/NormalModuleFactory.js:60:20
- NormalModuleFactory.js:127 asyncLib.parallel
[Sisketeers]/[webpack]/lib/NormalModuleFactory.js:127:20
- async.js:3874
[Sisketeers]/[async]/dist/async.js:3874:9
- async.js:473
[Sisketeers]/[async]/dist/async.js:473:16
- async.js:1048 iteratorCallback
[Sisketeers]/[async]/dist/async.js:1048:13
- async.js:958
[Sisketeers]/[async]/dist/async.js:958:16
- async.js:3871
[Sisketeers]/[async]/dist/async.js:3871:13
Child html-webpack-plugin for "index.html":
ERROR in Entry module not found: Error: Can't resolve '/Users/jurdekker/Desktop/OnWeb/OnWeb.react/Sisketeers/dist/index.html' in '/Users/jurdekker/Desktop/OnWeb/OnWeb.react/Sisketeers'
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js!node_modules/sass-loader/lib/loader.js!sass/main.scss:
[0] ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./sass/main.scss 1.27 kB {0} [built]
+ 1 hidden module
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! onweb-sisketeers@1.0.0 build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the onweb-sisketeers@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! /Users/jurdekker/.npm/_logs/2018-01-19T17_33_37_060Z-debug.log
Jurs-MacBook-Pro:Sisketeers jurdekker$
文件夹中,我收到一个dist
文件,但错误相同。我自己也不明白,所以如果有人可以提供更多相关信息,我想听听。
更新22-01-2018
这是我的webpack配置,我没有看到任何错误。也许你找到了什么?
.html
&#13;
答案 0 :(得分:1)
Webpack无法找到一些模块。需要检查你的webpack配置