5

I am new to AngularJS, just started an online course.

I am trying to install angular CLI on my computer at work running Windows 7. I opened command line as administrator and running npm install -g @angular/cli. Installation starts and after a few minutes I get an error: npm install -g angular-cli error

I see the notification "operation not permitted", but I am the administrator of the computer and the command line I run as administrator.

What am I doing wrong? The same installation I did on my laptop at home and it was successful.

I am checking with our IT support about other possible causes and will appreciate any help.

This is not a duplicate of Fail to install npm package “npm ERR! errno -4048” or npm install -g angular-cli fails.

Ignoring the error and running gn -v I get the following: Ignoring the error and running ng -v

Is this correct? Was Angular CLI installed?

Binyamin Regev
  • 914
  • 5
  • 19
  • 31
  • As far as I understand that `fsevents` library is used for watching when a file is saved in the file system. Despite the installation error it may still work for Angular CLI. That feature is called Hot Module Replacement. That's a development time feature. So until HMR doesn't work for you, you can ignore that error. – Andrey Nov 27 '17 at 19:05
  • And yes, it looks like the Angular CLI is installed. – Andrey Nov 27 '17 at 19:15
  • This is similar to [this question](https://stackoverflow.com/a/53817506/4657538) – Vignesh Dec 17 '18 at 14:47
  • @Vignesh, first the question you are referring to is similar to mine, because it was posted on December 7th, 2017 more than 10 days AFTER I posted my question. Second, after I did what @Andrey wrote and was blocked. I found the real answer to my questions - permissions on my computer at work, I called IT and found out hat the installation of `Angular-cli` was blocked by the company's security policy. – Binyamin Regev Dec 18 '18 at 10:31

5 Answers5

2

These issues are because of the company proxy settings.

Check with your admin to get the proxy for http or https.

It will be something like this:

http_proxy = http://http.myproxy.com:8000

https_proxy = http://http.myproxy.com:8000

Replace myproxy with the name of company proxy.

Then go to the command prompt and run the following command to set the proxy. Later you can run any command like npm install -g @angular/cli to run. It will work

npm config set proxy http://http.myproxy.com:8000

npm config set https-proxy http://http.myproxy.com:8000
Rot-man
  • 18,045
  • 12
  • 118
  • 124
Manjunatha B
  • 276
  • 3
  • 9
1

That fsevents library has peculiarities on Windows. So I suggest you ignore the error message and run ng -v from the command prompt to confirm you got the Angular CLI libraries installed.

Andrey
  • 559
  • 3
  • 6
  • I have ignored the error, then run `ng new hello-angular` to create a basic application to see if angular CLI is installed correctly. I got a similar error, ignored that one as well and run `npm install` - it was completed successfully. The run `ng serve` and checked that my "hello angular" application is running - it does. Proplem solved and case closed. – Binyamin Regev Dec 06 '17 at 12:16
0

As the error message suggest, you don't have some permissions to execute your command.

Depending on your system, you should run the command as an administrator.

Also, don't mix AngularJS (the first Angular framework) and Angular (also known as Angular 2, 4 and 5 now) . They are radically different in their syntax and uses.

Pac0
  • 21,465
  • 8
  • 65
  • 74
0

You need to run the npm commands on node.js command prompt but not on windows command line.

Workaround: install git bash on windows.

Akash Agrawal
  • 2,219
  • 1
  • 17
  • 38
0

Run below command and try installing angular cli again.

npm cache clean -f

This worked for me manytimes.

Fab
  • 14,327
  • 5
  • 49
  • 68