1

I tried reinstalling node.js a few times, and tried with different versions, and I still get the same error. I'm also running the CMD as administrator. It seems like it doesn't find json-schema, I even tried to install it manually, but same error appears. Here's the error message I get:

C:\> npm install -g @angular/cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\@angular\cli\node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\Users\admin\AppData\Roaming\npm\node_modules\.staging\fsevents-edb66af1\node_modules\asn1' -> 'C:\Users\admin\AppData\Roaming\npm\node_modules\.staging\asn1-98b68b78'

npm ERR! path C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@ngtools\json-schema
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@ngtools\json-schema' -> 'C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@ngtools\.json-schema.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-03-15T07_42_19_026Z-debug.log
Josep M Domingo
  • 39
  • 1
  • 2
  • 7

2 Answers2

0

Best way to do this is like you, first of all, try to uninstall node and angular from your machine and remove the related files then again install it one by one accordingly it will work as I faced the same issue before. I am attaching some links which help me for removing angular and node.

How to completely remove node.js from Windows

For removing completely angular

npm uninstall -g @angular/cli

npm cache verify

0

What version of npm are you running ('npm -v')?

I'd suggest that you run at least npm version 5.3.0 - the current version is 5.7.1, but I've run into issues (as have others) with permissions behavior on Windows with some of the later versions.

If you need to install a different version of npm, type the command npm install -g npm@5.3.0 (or whichever version you want to install).

Bill Turner
  • 980
  • 1
  • 6
  • 23