sth77 / spring-angular-ddd-hateoas

Code from my talk "Building better GUIs using DDD and Spring HATEOAS"
3 stars 5 forks source link

Build issues #1

Open mmoser18 opened 2 years ago

mmoser18 commented 2 years ago

I checked out the code and issued the suggested ./mvnw clean spring-boot:run but my build fails with the below error. What am I missing? M.

...
[INFO]
[INFO] c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\src\main.ts - Error: Module build failed (from c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\node_modules\@ngtools\webpack\src\ivy\index.js):
[INFO] Error: c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\src\main.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
[INFO]     at c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\node_modules\@ngtools\webpack\src\ivy\loader.js:43:26
[INFO]
[INFO] c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\src\polyfills.ts - Error: Module build failed (from c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\node_modules\@ngtools\webpack\src\ivy\index.js):
[INFO] Error: c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\src\polyfills.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
[INFO]     at c:\Projects\ELCA_SpringBoot_Template\code\ddd_hateoas_example\src\main\frontend\node_modules\@ngtools\webpack\src\ivy\loader.js:43:26
[INFO]
[INFO]
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! errno 1
[INFO] npm ERR! frontend@0.0.1-SNAPSHOT build: `ng build`
[INFO] npm ERR! Exit status 1
[INFO] npm ERR!
[INFO] npm ERR! Failed at the frontend@0.0.1-SNAPSHOT build script.
[INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO]
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR!     C:\Users\mms\AppData\Roaming\npm-cache\_logs\2022-01-16T17_00_42_723Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:08 min
[INFO] Finished at: 2022-01-16T18:00:42+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:npm (npm dist) on project demo: Failed to run task: 'npm run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
sth77 commented 2 years ago

I fixed the phases in the frontend maven plugin. Can you try again?

mmoser18 commented 2 years ago

Unfortunately still no joy:

D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example>.\mvnw clean spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ demo ---
[INFO] Deleting D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\target
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.6.2:run (default-cli) > test-compile @ demo >>>
[INFO]
[INFO] --- frontend-maven-plugin:1.12.1:install-node-and-npm (install node and npm) @ demo ---
[INFO] Installing node version v14.17.0
[INFO] Unpacking U:\.m2\m2repository\com\github\eirslett\node\14.17.0\node-14.17.0-win-x64.zip into D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend\node\tmp
[INFO] Copying node binary from D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend\node\tmp\node-v14.17.0-win-x64\node.exe to D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend\node\node.exe
[INFO] Installed node locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.12.1:npm (npm dist) @ demo ---
[INFO] Running 'npm run build' in D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend
[INFO]
[INFO] > frontend@0.0.1-SNAPSHOT build D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend
[INFO] > ng build
[INFO]
[INFO] An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
[INFO] Require stack:
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\architect\node\index.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\commands\build-impl.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\tools\export-ref.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\tools\index.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\utilities\json-schema.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\models\command-runner.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\lib\cli\index.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js
[INFO] - C:\Users\mms\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
[INFO] See "C:\Users\mms\AppData\Local\Temp\ng-vgos41\angular-errors.log" for further details.
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! syscall spawn
[INFO] npm ERR! file C:\WINDOWS\system32\cmd.exe
[INFO] npm ERR! errno ENOENT
[INFO] npm ERR! frontend@0.0.1-SNAPSHOT build: `ng build`
[INFO] npm ERR! spawn ENOENT
[INFO] npm ERR!
[INFO] npm ERR! Failed at the frontend@0.0.1-SNAPSHOT build script.
[INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO] npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[INFO]
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR!     C:\Users\mms\AppData\Roaming\npm-cache\_logs\2022-01-17T08_37_59_454Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  34.453 s
[INFO] Finished at: 2022-01-17T09:37:59+01:00

The mentioned log file contain:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'D:\\Projects\\ELCA_SpringBoot_Template\\code\\ddd-hateoas-example\\src\\main\\frontend\\node\\node.exe',
1 verbose cli   'D:\\Projects\\ELCA_SpringBoot_Template\\code\\ddd-hateoas-example\\src\\main\\frontend\\node\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using npm@6.14.13
3 info using node@v14.17.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle frontend@0.0.1-SNAPSHOT~prebuild: frontend@0.0.1-SNAPSHOT
6 info lifecycle frontend@0.0.1-SNAPSHOT~build: frontend@0.0.1-SNAPSHOT
7 verbose lifecycle frontend@0.0.1-SNAPSHOT~build: unsafe-perm in lifecycle true
8 verbose lifecycle frontend@0.0.1-SNAPSHOT~build: PATH: c:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend\node\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend\node_modules\.bin;D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend\node;C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Download\Win2K_SW\SysInternalsSuite;C:\Program Files\Dell\Dell Data Protection\Encryption\;C:\Program Files\Graphviz\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\\bin;C:\Program Files\Apache\Maven\bin;C:\Program Files\Git\cmd;C:\Program Files\Oracle\sqldeveloper-no-jre-19.2.1\sqldeveloper\bin;C:\ProgramFilesJunction\Oracle\oracle18cXE\dbhomeXE\bin;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Download\ELCA\oc;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\;C:\ProgramFilesJunction\Cygwin\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Download\DeveloperZone\Selenium\chromedriver_win32_95.0.4638.17;C:\Program Files\Dell\Dell Data Protection\Encryption\;C:\Users\mms\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\JetBrains\IntelliJ\bin;;C:\Users\mms\AppData\Roaming\npm;
9 verbose lifecycle frontend@0.0.1-SNAPSHOT~build: CWD: D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend
10 silly lifecycle frontend@0.0.1-SNAPSHOT~build: Args: [ '/d /s /c', 'ng build' ]
11 info lifecycle frontend@0.0.1-SNAPSHOT~build: Failed to exec build script
12 verbose stack Error: frontend@0.0.1-SNAPSHOT build: `ng build`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (c:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend\node\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:48:18)
12 verbose stack     at ChildProcess.emit (events.js:376:20)
12 verbose stack     at maybeClose (internal/child_process.js:1055:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
13 verbose pkgid frontend@0.0.1-SNAPSHOT
14 verbose cwd D:\Projects\ELCA_SpringBoot_Template\code\ddd-hateoas-example\src\main\frontend
15 verbose Windows_NT 10.0.18363
16 verbose argv "D:\\Projects\\ELCA_SpringBoot_Template\\code\\ddd-hateoas-example\\src\\main\\frontend\\node\\node.exe" "D:\\Projects\\ELCA_SpringBoot_Template\\code\\ddd-hateoas-example\\src\\main\\frontend\\node\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
17 verbose node v14.17.0
18 verbose npm  v6.14.13
19 error code ELIFECYCLE
20 error syscall spawn
21 error file C:\WINDOWS\system32\cmd.exe
22 error errno ENOENT
23 error frontend@0.0.1-SNAPSHOT build: `ng build`
23 error spawn ENOENT
24 error Failed at the frontend@0.0.1-SNAPSHOT build script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]