0
当我尝试npm install
一切似乎工作正常,但然后ng serve
返回错误。我正在尝试几乎所有东西,但没有任何效果。也许角度版本有问题?同一个项目正在另一台计算机上工作。任何建议有什么不对?从问题Angular 4 - webpack:无法编译
ERROR in Error: Child compilation failed:
Entry module not found: Error: Can't resolve '/Users/myUser/Desktop/to/Project/frontend/src/index.html' in '/Users/myUser/Desk top/to/Project/frontend/node_modules/@angular/cli/models/webpack-configs':
Error: Can't resolve '/Users/myUser/Desktop/to/Project/frontend/src/index.html' in '/Users/myUser/Desktop/to/Project/frontend/node _modules/@angular/cli/models/webpack-configs'
- compiler.js:76
[frontend]/[html-webpack-plugin]/lib/compiler.js:76:16
- Compiler.js:291 Compiler.<anonymous>
[frontend]/[webpack]/lib/Compiler.js:291:10
- Compiler.js:494
[frontend]/[webpack]/lib/Compiler.js:494:13
- Tapable.js:138 next
[frontend]/[tapable]/lib/Tapable.js:138:11
- CachePlugin.js:62 Compiler.<anonymous>
[frontend]/[webpack]/lib/CachePlugin.js:62:5
- Tapable.js:142 Compiler.applyPluginsAsyncSeries
[frontend]/[tapable]/lib/Tapable.js:142:13
- Compiler.js:491
[frontend]/[webpack]/lib/Compiler.js:491:10
- Tapable.js:131 Compilation.applyPluginsAsyncSeries
[frontend]/[tapable]/lib/Tapable.js:131:46
- Compilation.js:645 self.applyPluginsAsync.err
[frontend]/[webpack]/lib/Compilation.js:645:19
- Tapable.js:131 Compilation.applyPluginsAsyncSeries
[frontend]/[tapable]/lib/Tapable.js:131:46
- Compilation.js:636 self.applyPluginsAsync.err
[frontend]/[webpack]/lib/Compilation.js:636:11
- Tapable.js:131 Compilation.applyPluginsAsyncSeries
[frontend]/[tapable]/lib/Tapable.js:131:46
- Compilation.js:631 self.applyPluginsAsync.err
[frontend]/[webpack]/lib/Compilation.js:631:10
- Tapable.js:131 Compilation.applyPluginsAsyncSeries
[frontend]/[tapable]/lib/Tapable.js:131:46
- Compilation.js:627 sealPart2
[frontend]/[webpack]/lib/Compilation.js:627:9
- Tapable.js:131 Compilation.applyPluginsAsyncSeries
[frontend]/[tapable]/lib/Tapable.js:131:46
webpack: Failed to compile.
你是否也可以发布你的ur文件结构? – Dhyey
看起来您的项目根目录中没有“index.html”。 – Lansana
是的,这是造成问题的原因。我在我的文件结构中添加了'index.html',一切正常。 – wahtdbogh