1
votes

Angular installation failing with the below error and angular is not installed.

D:\software\node-v8.11.2-win-x64>npm install -g @angular/cli D:\software\node-v8.11.2-win-x64\ng -> D:\eclipse\software\node-v8.11.2-win-x64\node_modules@angular\cli\bin\ng

@angular/[email protected] postinstall D:\eclipse\software\node-v8.11.2-win-x64\node_modules@angular\cli node ./bin/ng-update-message.js

'node' is not recognized as an internal or external command, operable program or batch file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules@angular\cli\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @angular/[email protected] postinstall: node ./bin/ng-update-message.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @angular/[email protected] postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\N96304.LAUNCHER\AppData\Roaming\npm-cache_logs\2018-06-19T08_39_53_490Z-debug.lo

Errors in log :

8474 info lifecycle @angular/[email protected]~postinstall: @angular/[email protected]
8475 verbose lifecycle @angular/[email protected]~postinstall: unsafe-perm in lifecycle true
8476 verbose lifecycle @angular/[email protected]~postinstall: PATH: D:software\node-v8.11.2-win-x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:software\node-v8.11.2-win-x64\node_modules\@angular\cli\node_modules\.bin;D:software\node-v8.11.2-win-x64\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files (x86)\EHLLAPI\;C:\Program Files (x86)\PortalClient\;C:\Program Files (x86)\Citrix\ICAService;C:\Program Files (x86)\Citrix\System32;C:\Program Files (x86)\InstallShield\AdminStudio\6.0\ConflictSolver;C:\Program Files (x86)\Common Files\Citrix\system32;C:\Program Files\Citrix\System32\;C:\Program Files\Citrix\ICAService\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\instantclient_12_2;C:\Program Files\instantclient_12_2;D:software\New folder\Fiddler;D:software\Fiddler
8477 verbose lifecycle @angular/[email protected]~postinstall: CWD: D:software\node-v8.11.2-win-x64\node_modules\@angular\cli
8478 silly lifecycle @angular/[email protected]~postinstall: Args: [ '/d /s /c', 'node ./bin/ng-update-message.js' ]
8479 silly lifecycle @angular/[email protected]~postinstall: Returned: code: 1  signal: null
8480 info lifecycle @angular/[email protected]~postinstall: Failed to exec postinstall script
8481 verbose unlock done using C:\Users\N96304.LAUNCHER\AppData\Roaming\npm-cache\_locks\staging-acb702ed8f4300ec.lock for D:software\node-v8.11.2-win-x64\node_modules\.staging
8482 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@angular\cli\node_modules\fsevents):
8483 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
8485 verbose stack Error: @angular/[email protected] postinstall: `node ./bin/ng-update-message.js`
8485 verbose stack Exit status 1
8485 verbose stack     at EventEmitter.<anonymous> (D:software\node-v8.11.2-win-x64\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
8485 verbose stack     at emitTwo (events.js:126:13)
8485 verbose stack     at EventEmitter.emit (events.js:214:7)
8485 verbose stack     at ChildProcess.<anonymous> (D:software\node-v8.11.2-win-x64\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
8485 verbose stack     at emitTwo (events.js:126:13)
8485 verbose stack     at ChildProcess.emit (events.js:214:7)
8485 verbose stack     at maybeClose (internal/child_process.js:925:16)
8485 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
8486 verbose pkgid @angular/[email protected]
8487 verbose cwd D:software\node-v8.11.2-win-x64
8488 verbose Windows_NT 6.1.7601
8489 verbose argv "D:\\software\\node-v8.11.2-win-x64\\node.exe" "D:\\software\\node-v8.11.2-win-x64\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
8490 verbose node v8.11.2
8491 verbose npm  v5.6.0
8492 error code ELIFECYCLE
8493 error errno 1
8494 error @angular/[email protected] postinstall: `node ./bin/ng-update-message.js`
8494 error Exit status 1
8495 error Failed at the @angular/[email protected] postinstall script.
8495 error This is probably not a problem with npm. There is likely additional logging output above.
8496 verbose exit [ 1, true ]
3
need to install nodeSachila Ranawaka
Check if you have node in path. Open Cmd and write node.pagep
try npm cache clean --force and then npm install -g @angular/cliVikas
are you running as an admin?Daniel A. White

3 Answers

0
votes

Please re-install your node.js and retry. Make sure, that you have Node.js in your environmental variable PATH. You can also try to reinstall Angular-CLI.

0
votes

Simply add node in your system Variable : variable : node , path : C:\Program Files\nodejs.

0
votes

CMD --> Run as administrator --> C:\Program Files\nodejs> npm install -g @angular/cli