-1

I am trying to install angular-cli using latest versions of npm(5.3.0) and node (v8.2.1) on Windows7 64 bit environment. npm and node are working as expected.

But when I try to install angular-cli using the command:

npm install -g @angular/cli

It is failing after copying all the required files to the appdata/Raoming/npm folder. Below is the error stack trace:

11902 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11903 verbose cwd C:\Windows\system32
11904 verbose Windows_NT 6.1.7601
11905 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
11906 verbose node v8.2.1
11907 verbose npm  v5.3.0
11908 error path C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090
11909 error code EPERM
11910 error errno -4048
11911 error syscall rename
11912 error Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error  { Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error   cause:
11912 error    { Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error      errno: -4048,
11912 error      code: 'EPERM',
11912 error      syscall: 'rename',
11912 error      path: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090',
11912 error      dest: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json' },
11912 error   stack: 'Error: EPERM: operation not permitted, rename \'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090\' -> \'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json\'',
11912 error   errno: -4048,
11912 error   code: 'EPERM',
11912 error   syscall: 'rename',
11912 error   path: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090',
11912 error   dest: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json',
11912 error   parent: 'webpack-dev-server' }
11913 error Please try running this command again as root/Administrator.
11914 verbose exit [ -4048, true ]

Note: I was successful in installing this on my MAC OS. I tried uninstalling npm and node, reinstalled again and tried again, but did not work. I have administrator access on the machine that I am working on. Tried running the command prompt as Administrator as well.

halfer
  • 19,824
  • 17
  • 99
  • 186
Mahi M
  • 569
  • 1
  • 4
  • 11
  • Go to Start -> cmd -> right click -> run as administrator and run the command again – dlcardozo Aug 09 '17 at 17:55
  • Tried it camaron. But didn't help. – Mahi M Aug 09 '17 at 17:56
  • Do you have an anti-virus running on that machine? If you have one just shutdown it and try again. – dlcardozo Aug 09 '17 at 18:00
  • Right guess. I have McAfee running on my machine. I tried to stop some of the services and ran it but still did not work. I checked the McAfee console, looks like there is nothing in the logs that it is blocking. – Mahi M Aug 09 '17 at 18:11
  • try npm cache clean – Vikhyath Maiya Aug 09 '17 at 18:27
  • Possible duplicate of [npm install error ( npm install -g angular-cli ) in windows 10](https://stackoverflow.com/questions/44416465/npm-install-error-npm-install-g-angular-cli-in-windows-10) – halfer Oct 08 '17 at 23:22
  • 1
    It looks like this question was solved with an answer below that is a carbon-copy of an answer given to the proposed duplicate I have indicated. I think that means the question is also a duplicate, so voting to put on hold for now. – halfer Oct 08 '17 at 23:23

1 Answers1

1

You might need to use Node6 for 32-bit support.

TMW
  • 11
  • 1