I was able to install nodejs version v10.7.0 and npm version 6.1.0 without any issues. Also installed angular 1.7.2 and typescript 2.9.2.I am getting this below error on trying to install npm install -g @angular/cli@latest.
I have tried all of the debug steps I could find online, including force clearing the cache and installing and uninstalling nodejs and adding my system32 folder to the PATH variable. Mostly followed this article I thought was very helpful - How do you install angular-cli for windows 7
7904 info lifecycle @schematics/angular@0.6.8~postinstall: @schematics/angular@0.6.8
7905 silly postinstall @schematics/update@0.6.8
7906 info lifecycle @schematics/update@0.6.8~postinstall: @schematics/update@0.6.8
7907 silly postinstall opn@5.3.0
7908 info lifecycle opn@5.3.0~postinstall: opn@5.3.0
7909 silly postinstall resolve@1.8.1
7910 info lifecycle resolve@1.8.1~postinstall: resolve@1.8.1
7911 silly postinstall silent-error@1.1.0
7912 info lifecycle silent-error@1.1.0~postinstall: silent-error@1.1.0
7913 silly postinstall symbol-observable@1.2.0
7914 info lifecycle symbol-observable@1.2.0~postinstall: symbol-observable@1.2.0
7915 silly postinstall yargs-parser@10.1.0
7916 info lifecycle yargs-parser@10.1.0~postinstall: yargs-parser@10.1.0
7917 silly postinstall @angular/cli@6.0.8
7918 info lifecycle @angular/cli@6.0.8~postinstall: @angular/cli@6.0.8
7919 verbose lifecycle @angular/cli@6.0.8~postinstall: unsafe-perm in lifecycle true
7920 verbose lifecycle @angular/cli@6.0.8~postinstall: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Nidhin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\.bin;C:\Users\Nidhin\AppData\Roaming\npm\node_modules\.bin;C:\Windows\System32;C:\Users\Nidhin\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\Nidhin\AppData\Local\Programs\Python\Python37\;C:\Users\Nidhin\AppData\Local\Programs\Fiddler;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\nodejs\;C:\Users\Nidhin\AppData\Roaming\npm;C:\Windows\System32;C:\Windows\System32;C:\Users\Nidhin\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\Nidhin\AppData\Local\Programs\Python\Python37\;C:\Users\Nidhin\AppData\Local\Programs\Fiddler;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\nodejs\;C:\Users\Nidhin\AppData\Roaming\npm;C:\Windows\System32;C:\WINDOWS/system32/WindowsPowerShell/v1.0
7921 verbose lifecycle @angular/cli@6.0.8~postinstall: CWD: C:\Users\Nidhin\AppData\Roaming\npm\node_modules\@angular\cli
7922 silly lifecycle @angular/cli@6.0.8~postinstall: Args: [ '/d /s /c', 'node ./bin/ng-update-message.js' ]
7923 info lifecycle @angular/cli@6.0.8~postinstall: Failed to exec postinstall script
7924 silly lifecycle @angular/cli@6.0.8~postinstall: Returned: code: -4058 signal: null
7925 info lifecycle @angular/cli@6.0.8~postinstall: Failed to exec postinstall script
7926 timing action:postinstall Completed in 679ms
7927 verbose unlock done using C:\Users\Nidhin\AppData\Roaming\npm-cache\_locks\staging-2479c5e9a87c27dd.lock for C:\Users\Nidhin\AppData\Roaming\npm\node_modules\.staging
7928 warn rollback Rolling back is-descriptor@1.0.2 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\Nidhin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\define-property\node_modules'
7929 warn rollback Rolling back is-extendable@1.0.1 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\Nidhin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\mixin-deep\node_modules'
7930 warn rollback Rolling back define-property@1.0.0 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\Nidhin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\snapdragon-node\node_modules'
7931 warn rollback Rolling back kind-of@3.2.2 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\Nidhin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\to-object-path\node_modules'
7932 timing stage:rollbackFailedOptional Completed in 3584ms
7933 timing stage:runTopLevelLifecycles Completed in 135690ms
7934 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\@angular\cli\node_modules\fsevents):
7935 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
7936 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
7936 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
7936 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
7936 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
7937 verbose stack Error: @angular/cli@6.0.8 postinstall: `node ./bin/ng-update-message.js`
7937 verbose stack spawn C:\Windows\System32\cmd.exe; ENOENT
7937 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
7937 verbose stack at onErrorNT (internal/child_process.js:406:16)
7937 verbose stack at process._tickCallback (internal/process/next_tick.js:63:19)
7938 verbose pkgid @angular/cli@6.0.8
7939 verbose cwd C:\WINDOWS\system32
7940 verbose Windows_NT 6.1.7601
7941 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli@latest"
7942 verbose node v10.7.0
7943 verbose npm v6.1.0
7944 error file C:\Windows\System32\cmd.exe;
7945 error path C:\Windows\System32\cmd.exe;
7946 error code ELIFECYCLE
7947 error errno ENOENT
7948 error syscall spawn C:\Windows\System32\cmd.exe;
7949 error @angular/cli@6.0.8 postinstall: `node ./bin/ng-update-message.js`
7949 error spawn C:\Windows\System32\cmd.exe; ENOENT
7950 error Failed at the @angular/cli@6.0.8 postinstall script.
7950 error This is probably not a problem with npm. There is likely additional logging output above.
7951 verbose exit [ 1, true ]