1
votes

Error while running: npm install -g angular-cli

C:\Windows\System32>node -v
v7.5.0
C:\Windows\System32>npm -v
4.1.2
C:\Users\Chiranjeevi>npm -v minimatch
4.1.2
-------------------------------------------------------------------------------------------
C:\Users\Chiranjeevi>npm install -g angular-cli

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
C:\Users\Chiranjeevi\AppData\Roaming\npm `-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\angular-cli\node_modules\chokidar\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 @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! path C:\Users\Chiranjeevi\AppData\Roaming\npm\node_modules\.staging\yallist-2cab1649\package.json.797219503
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Chiranjeevi\AppData\Roaming\npm\node_modules\.staging\yallist-2cab1649\package.json.797219503' -> 'C:\Users\Chiranjeevi\AppData\Roaming\npm\node_modules\.staging\yallist-2cab1649\package.json'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Chiranjeevi\AppData\Roaming\npm\node_modules\.staging\yallist-2cab1649\package.json.797219503' -> 'C:\Users\Chiranjeevi\AppData\Roaming\npm\node_modules\.staging\yallist-2cab1649\package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Chiranjeevi\npm-debug.log

enter image description here

3

3 Answers

2
votes

You should execute npm cache clean instead of npm clear cache (see https://docs.npmjs.com/cli/cache).

Regarding npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed.: There is an open angular cli issue concerning rxjs. As a workaraound, you can execute npm install -g rxjs.

Additionally, the npm package name for angular cli changed from angular-cli to @angular-cli.

That is, the following might help: npm uninstall -g angular-cli npm cache clean npm install -g rxjs npm install -g @angular/cli

0
votes

Try to run npm clear cache

and than npm install -g angular-cli

0
votes

Make sure you have latest Nodejs(LTS version) installed. Try following

  1. npm i npm -g
  2. npm cache clean
  3. npm install -g @angular/cli