Skip to content

unhelpful error in angular build #21402

@mhamri

Description

@mhamri

I'm in the middle of migrating the angular from 11 to 12 and something is broken, the sad part is angular is really unhelpful on the showing the reason and just god knows how should I figure out the issue and solve it.

now the main question is how do I approach this?

❯ npm run build -- --prod

> frontend@0.0.0 build C:\repo\PPMS2\frontend-temp
> ng build "--prod"

Option "--prod" is deprecated: No need to use this option as this builder defaults to configuration "production".
✔ Browser application bundle generation complete.
✔ Copying assets complete.
✖ Index html generation failed.
undefined:16:330554: property missing ':'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@0.0.0 build: `ng build "--prod"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.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\amrim\AppData\Roaming\npm-cache\_logs\2021-07-22T15_04_42_403Z-debug.log

and this is the log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build',
1 verbose cli   '--',
1 verbose cli   '--prod'
1 verbose cli ]
2 info using npm@6.14.11
3 info using node@v14.16.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle frontend@0.0.0~prebuild: frontend@0.0.0
6 info lifecycle frontend@0.0.0~build: frontend@0.0.0
7 verbose lifecycle frontend@0.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle frontend@0.0.0~build: PATH: C:\Users\amrim\AppData\Roaming\nvm\v14.16.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\repo\PPMS2\frontend-temp\node_modules\.bin;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\jdk-11.0.10.9-hotspot\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\WinMerge;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\LINQPad6;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\ProgramData\chocolatey\bin;C:\ProgramData\chocolatey\lib\mpv.install\tools;;C:\Program Files\PowerShell\7\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\amrim\AppData\Local\Microsoft\WindowsApps;C:\Users\amrim\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\amrim\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\amrim\.dotnet\tools;C:\Users\amrim\.dotnet\tools;C:\Program Files\Azure Data Studio\bin
9 verbose lifecycle frontend@0.0.0~build: CWD: C:\repo\PPMS2\frontend-temp
10 silly lifecycle frontend@0.0.0~build: Args: [ '/d /s /c', 'ng build "--prod"' ]
11 silly lifecycle frontend@0.0.0~build: Returned: code: 1  signal: null
12 info lifecycle frontend@0.0.0~build: Failed to exec build script
13 verbose stack Error: frontend@0.0.0 build: `ng build "--prod"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\amrim\AppData\Roaming\nvm\v14.16.0\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\amrim\AppData\Roaming\nvm\v14.16.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid frontend@0.0.0
15 verbose cwd C:\repo\PPMS2\frontend-temp
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" "--" "--prod"
18 verbose node v14.16.0
19 verbose npm  v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error frontend@0.0.0 build: `ng build "--prod"`
22 error Exit status 1
23 error Failed at the frontend@0.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions