angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Install fails on Windows 7

Open KyleCrowley opened this issue 10 years ago • 29 comments

OS: Windows 7

Node/NPM Version (Install failed. Can't run ng):

node -v
v6.3.0 

npm -v
3.10.6

NOTE: Node version doesn't matter. Tested on 4.4.7 as well. No change.

Reproduction Steps:

Run npm install -g angular-cli on Windows 7

Log:

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Kyle\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\n
pm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.6
npm ERR! path C:\Users\Kyle\AppData\Roaming\npm\node_modules\.angular-cli.DELETE\node_modules\traceur
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\.angular-cli.DE
LETE\node_modules\traceur' -> 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\angular-cli\node_modules\traceur'
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:64:7
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:52:35
npm ERR!     at Array.forEach (native)
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:52:11
npm ERR!     at Array.forEach (native)
npm ERR!     at asyncMap (C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:51:8)

npm ERR!     at moveModules (C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:61:5)
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:56:70
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\mkdirp\index.js:30:20
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\.angular-cli.DE
LETE\node_modules\traceur' -> 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\angular-cli\node_modules\traceur'
npm ERR!     at Error (native)
npm ERR!  Error: EPERM: operation not permitted, rename 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\.angular-cli.D
ELETE\node_modules\traceur' -> 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\angular-cli\node_modules\traceur'
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:64:7
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:52:35
npm ERR!     at Array.forEach (native)
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:52:11
npm ERR!     at Array.forEach (native)
npm ERR!     at asyncMap (C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:51:8)

npm ERR!     at moveModules (C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:61:5)
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:56:70
npm ERR!     at C:\Users\Kyle\AppData\Roaming\npm\node_modules\npm\node_modules\mkdirp\index.js:30:20
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\.angular-cli.DE
LETE\node_modules\traceur' -> 'C:\Users\Kyle\AppData\Roaming\npm\node_modules\angular-cli\node_modules\traceur'
npm ERR!     at Error (native)
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Kyle\npm-debug.log
npm ERR! code 1

NOTES:

  1. Running as an administrator DOES NOT change anything. This includes if I EXPLICITY run cmd.exe as admin. It should not matter, but I tested it regardless...

  2. I've already searched high and low for a solution. I saw some info that related to ember-cli, but any of the proposed solutions do not apply. For example, there was some info about missing a permission to create symlinks. Does not apply in my case; I have the permission.

  3. I have typings installed globally already.

I can test this later on my personal computer (this is a corporate computer), but I don't feel it will do much good (that machine is running Windows 10).

KyleCrowley avatar Jul 14 '16 20:07 KyleCrowley

It was solved for me by executing the npm i @angular/cli -g from the command prompt instead of the node.js prompt.

neumn avatar Sep 03 '17 07:09 neumn

i still experience the same error with windows 7. i followed all these but did not work. please help how can i install angular.

thanks in advance.

snatuva avatar Oct 30 '17 09:10 snatuva

I tried after deleting the folder C:\Users\User\AppData\Roaming\npm\node_modules@angular\cli, it was able to install.

Radhakanta avatar Nov 27 '17 04:11 Radhakanta

@Radhakanta you know that once you delete that folder you won't be able to use npm anymore, right? If yes, why are you sharing this? Don't share your ignorancy please.

C:\Users\primeiro.ultimo\AppData\Roaming\npm>npm i @angular/cli -g module.js:471 throw err; ^

Error: Cannot find module 'C:\Users\primeiro.ultimo\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:389:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:504:3

mikerames avatar Dec 10 '17 01:12 mikerames

Hello, I found a work around, I've got the same error while trying to install @angular/cli.

image

I've created mannually the directories that npm couldn't rename, and for each directory created i rerun "npm install -g @angular/cli" ( i did this for 4 directories ).

image

My Config: Npm -v : 5.5.1 Node -V : 8.9.1 Win 7 Entreprise

TrabMe avatar Dec 12 '17 15:12 TrabMe

It's most probably anti-virus causing issues.

jamiebarrow avatar Feb 01 '18 12:02 jamiebarrow

  1. Run command prompt as Administrator.
  2. Ran npm clean cache. After run this command and return Error than run . ( npm cache clean --force )
  3. npm install -g angular-cli

patelvasu avatar Aug 09 '18 17:08 patelvasu

@patelvasu The npm package has been renamed to @angular/cli for a long time. It is high time you upgrade it.

Also, your 2nd step is not necessary anymore. In your case, all you need to do is:

  • npm uninstall -g angular-cli
  • npm install -g @angular/cli

You may have to look into upgrading your code base eventually, a lot things have changed since the npm package used to be called angular-cli.

catull avatar Aug 10 '18 06:08 catull

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.