Could not able to install angular/cli - getting [email protected] postinstall error
Versions
Node -v = v6.10.2 npm -v = v5.6.0 Window 7 version
Repro steps
By entering the below command, get the following error(in observed behaviour). I don't know how to fix this error D:>npm i -g @angular/cli
Observed behavior
D:>npm i -g @angular/cli C:\Users\barumugam2\AppData\Roaming\npm\ng -> C:\Users\barumugam2\AppData\Roaming\npm\node_modules@angular\cli\bin\ng
[email protected] install C:\Users\barumugam2\AppData\Roaming\npm\node_modules@angular\cli\node_modules\node-sass node scripts/install.js
[email protected] postinstall C:\Users\barumugam2\AppData\Roaming\npm\node_modules@angular\cli\node_modules\webpack\node_modules\uglifyjs-webpack-plugin node lib/post_install.js
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\barumugam2\AppData\Roaming\npm\node_modules@angular\cli\node_modules' 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 WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules@angular\cli\node_modules\node-sass): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install:
node scripts/install.jsnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn C:\Windows\system32\cmd.exe; ENOENTnpm ERR! file C:\Windows\system32\cmd.exe; npm ERR! path C:\Windows\system32\cmd.exe; npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn C:\Windows\system32\cmd.exe; npm ERR! [email protected] postinstall:
node lib/post_install.jsnpm ERR! spawn C:\Windows\system32\cmd.exe; ENOENT npm ERR! npm ERR! Failed at the [email protected] postinstall 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\barumugam2\AppData\Roaming\npm-cache_logs\2018-01-08T13_30_38_133Z-debug.log
Desired behavior
I should not get this error, initially i was not getting any error, i'm not sure how i can fix this error. because of this we are stuck of the production release.
Please guide us, to fix this issue.
Thanks Babu
This seems like a problem with your node/npm and not with Angular CLI.
Please have a look at the fixing npm permissions page, common errors page, npm issue tracker, or open a new issue in that issue tracker if the problem you are experiencing isn't known.
Hi @babupca , How did you handle the solution for this error?, I'm having the same issue after update @angular/cli.
Cheers,
Edwin Torres.
@codesandtags , I struggled a bit lot to fix this issue. This might be because of two scenarios likely in my case.
-
Check the proxy settings, I'm inside a company so i have set the internet proxy to allow the downloads
-
downgrade the npm versions, i did this, then it was working fine Node -v = v6.10.2 npm -v = v3.10.10
Try it out, lets see whether it resolves for you
Thanks a lot @babupca, finally, I did the next things in order to solve my problem :
- Downgrade the angular-cli to 1.6.0
- npm cache clean
- Install again the node dependencies in the project.
PS: I'm using node 8.9.4
Hi, I just had the same problem. Steps to solve
- uninstall your node and delete all the cache
- install it again:
- type on your CMD: npm init, just type enter to install all the default data
- end with npm install -g @angular/cli
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.