angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Could not able to install angular/cli - getting [email protected] postinstall error

Open babupca opened this issue 8 years ago • 6 comments

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.js npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn C:\Windows\system32\cmd.exe; ENOENT

npm 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.js npm 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

package.txt

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

babupca avatar Jan 08 '18 13:01 babupca

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.

clydin avatar Jan 08 '18 16:01 clydin

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 avatar Jan 29 '18 19:01 codesandtags

@codesandtags , I struggled a bit lot to fix this issue. This might be because of two scenarios likely in my case.

  1. Check the proxy settings, I'm inside a company so i have set the internet proxy to allow the downloads

  2. 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

babupca avatar Jan 30 '18 06:01 babupca

Thanks a lot @babupca, finally, I did the next things in order to solve my problem :

  1. Downgrade the angular-cli to 1.6.0
  2. npm cache clean
  3. Install again the node dependencies in the project.

PS: I'm using node 8.9.4

codesandtags avatar Jan 31 '18 19:01 codesandtags

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

D-US avatar Mar 09 '18 09:03 D-US

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.