1

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 minimatch@2.0.10: 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 fsevents@1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @angular/core@2.4.6 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

Chiranjeevi
  • 41
  • 1
  • 7

3 Answers3

2

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

Regarding npm WARN @angular/core@2.4.6 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

vsdev
  • 321
  • 1
  • 2
  • 8
  • `npm install -g rxjs` was enough for me – yunandtidus Feb 06 '17 at 10:19
  • npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Chiranjeevi\AppData\Roaming\npm\node_modules\.staging\css-parse-3e224c20\package.json.27297876' -> 'C:\Users\Chiranjeevi\AppData\Roaming\npm\node_modules\.staging\css-parse-3e224c20\package.json' – Chiranjeevi Feb 07 '17 at 18:52
  • It couldn't find npm in global, so you might need to re-install node_module in global by re-installing node. – surendrapanday May 23 '19 at 05:47
0

Try to run npm clear cache

and than npm install -g angular-cli

Yoav Schniederman
  • 5,253
  • 3
  • 28
  • 32
0

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
Raj Kumar
  • 758
  • 6
  • 12