Unable to install CLI on Windows 7
Versions
Windows 7 Enterprise SP1 Node: v4.6.1 NPM: v3.10.8 My user account is an Administrator on PC
The errors state that the process could not rename some files. As I stated above, I am an administrator on this PC so there should be any reasons for not having permission.
The log given by the failure.
I ran the following command at an Administrator Command prompt:
C:\_Dev\joswalt>npm install -g angular-cli
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update t
o graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This package is discontinued. Use lodash@^4.0.0.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
C:\Users\joswalt\AppData\Roaming\npm
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\angular-cli\node_modules\chokidar\node_mod
ules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"an
y"} (current: {"os":"win32","arch":"x64"})
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\PROGRA~1\\nodejs\\node.exe" "C:\\Users\\joswalt\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-c
li.js" "install" "-g" "angular-cli"
npm ERR! node v4.6.1
npm ERR! npm v3.10.8
npm ERR! path C:\Users\joswalt\AppData\Roaming\npm\node_modules\angular-cli\node_modules\@angular-cli\ast-tools
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\joswalt\AppData\Roaming\npm\node_modules\angular-cli\no
de_modules\@angular-cli\ast-tools' -> 'C:\Users\joswalt\AppData\Roaming\npm\node_modules\angular-cli\node_modules\@angul
ar-cli\.ast-tools.DELETE'
npm ERR! at moveAway (C:\Users\joswalt\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR! at destStatted (C:\Users\joswalt\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\joswalt\AppData\Roaming\npm\node_modules\angular-cli\no
de_modules\@angular-cli\ast-tools' -> 'C:\Users\joswalt\AppData\Roaming\npm\node_modules\angular-cli\node_modules\@angul
ar-cli\.ast-tools.DELETE'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, rename 'C:\Users\joswalt\AppData\Roaming\npm\node_modules\angular-cl
i\node_modules\@angular-cli\ast-tools' -> 'C:\Users\joswalt\AppData\Roaming\npm\node_modules\angular-cli\node_modules\@a
ngular-cli\.ast-tools.DELETE'] parent: 'angular-cli' }
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:\_Dev\joswalt\npm-debug.log
npm ERR! code 1
Having exactly the same problem on Win8 ...
Kind regards, Johnny Driesen
Have you tried uninstalling first?
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli
Hi Praseetht,
Thanks for your quick reply.
Followed your steps, but doesn't really bring a solution...
Here is a log-dump (Im using npm v 3.10.8 )
D:\projects\web\htdocs\quick-start>npm install -g angular-cli
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail o
n node releases >= v7.0. Please updae to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This package is discontinued. Use lodash@
^4.0.0.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie h
ttps://nodesecurity.io/advisories/130
C:\Users\johnny\AppData\Roaming\npm
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\an
gular-cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"
})
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\johnny\\AppData\
\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v4.6.1
npm ERR! npm v3.10.8
npm ERR! path C:\Users\johnny\AppData\Roaming\npm\node_modules\.staging\ember-cl
i-path-utils-fed14f25\package.json.1329419529
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\johnny\AppData\
Roaming\npm\node_modules\.staging\ember-cli-path-utils-fed14f25\package.json.132
9419529' -> 'C:\Users\johnny\AppData\Roaming\npm\node_modules\.staging\ember-cli
-path-utils-fed14f25\package.json'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, rename 'C:\Users\johnny\AppD
ata\Roaming\npm\node_modules\.staging\ember-cli-path-utils-fed14f25\package.json
.1329419529' -> 'C:\Users\johnny\AppData\Roaming\npm\node_modules\.staging\ember
-cli-path-utils-fed14f25\package.json']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\johnny\\AppData\\Roaming\\npm\\node_modules\\.stagi
ng\\ember-cli-path-utils-fed14f25\\package.json.1329419529',
npm ERR! dest: 'C:\\Users\\johnny\\AppData\\Roaming\\npm\\node_modules\\.stagi
ng\\ember-cli-path-utils-fed14f25\\package.json',
npm ERR! parent: 'angular-cli' }
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! D:\projects\web\htdocs\quick-start\npm-debug.log
npm ERR! code 1
D:\projects\web\htdocs\quick-start>
Thanks in advance for your help !!
Kind regards, Johnny
EPERM errors are due to your permissions settings.
If you installed the CLI using an Elevated process (Command Prompt or Powershell) you need to keep using an elevated process as the CLI generated files requiring them.
I'd uninstall (With an elevated prompt) and see if installing from a non-elevated prompt or Powershell helps. This fixed my issue the last time it came up.
Thanks for this info gelliott181 .
Yes , indeed. I installed it via a command prompt (with administrator rights) Sorry if this question sounds stupid, but what is an 'non-elevated' prompt ?
Thanks in advance for your reply, Johnny
A non-elevated prompt is a prompt without administrative permissions. In this case it means the prompt cannot perform administrative actions without activating a UAC prompt first.
The term elevated permissions is a platform agnostic way to handle this conversation as the same issue happens to *nix users who install using sudo. It simply means the process has been run as an administrative or otherwise highly-privileged user, and attempting to modify assets made by that process must be done with the same or higher permissions (higher in the hierarchy -> elevation).
Hope that helps you clear things up! Also, a tip I have is to install as a normal user, then run as an administrator during development as the Readme suggests. Not doing so degrades the dev server performance severely.
People have reported EPERM issues when AntiVirus is running on the machine. See this for instance.
Try disabling it. May be a stupid idea, but worth a shot. ¯\_(ツ)_/¯
Very clear explanation, gelliott181. Thank you !! @ praseetht... Gonna give it a try. Will keep you informed.
Grtz, Johnny.
Folks, I got it all working...
I first removed all old stuff. Started up a command prompt as Administrator WinKey+X => Command Prompt (Admin)
npm uninstall -g angular-cli
npm cache clean
Next, I 'forced' the installation of angular-cli
npm install -g -f angular-cli
(this took a while, but it succeeded)
Check your version ...
ng version
In my case, resulted in 1.0.0-beta.18
Next, I created my first project under my htdocs folder
cd \
cd <your_htdocs_folder>
ng new PROJECT_NAME
cd PROJECT_NAME
ng serve
Last step: open your browser and go to
http://localhost:4200/
And... EUREKA ... 'App works' is shown on the screen.
Thanks EVERYBODY out here for your help. I'm a newbie concerning npm, and without your help, I still wouldn't have a solution. So, thanks again !
Have a great day, Johnny
Yes, this process partially installs angular-cli. I have uninstalled the CLI and performed a npm cache clean, but I still get the same error.
I've done the following from an elevated command prompt:
npm uninstall -g angular-cli
npm -g cache clean
npm install -g -f angular-cli
I am still getting the error. I am the administrator on my pc. This is a work a pc, so I am not able to disable the antivirus if that is possibly the causing the problem.
You want to run the uninstall with elevated permissions, then as a normal user reinstall to avoid these errors. Do not run the cache clean or install commands with elevated permissions. On Sat, Oct 22, 2016 at 10:05 AM John Oswalt [email protected] wrote:
Yes, this process partially installs angular-cli. I have uninstalled the CLI and performed a npm cache clean, but I still get the same error.
I've done the following from an elevated command prompt:
npm uninstall -g angular-cli npm -g cache clean npm install -g -f angular-cli
I am still getting the error. I am the administrator on my pc. This is a work a pc, so I am not able to disable the antivirus if that is possibly the causing the problem.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/2807#issuecomment-255530282, or mute the thread https://github.com/notifications/unsubscribe-auth/ADajDaGkDZ_SBsAuke39sf7JlnYw8sJYks5q2hgTgaJpZM4KcpDX .
@gelliott181's answers are spot on. EPERM errors are always related to permission errors and there's really nothing we can do on the CLI itself. It means that NPM can't move those files around.
I understand you're getting this on windows but it's a similar thing to this common OSX issue: https://docs.npmjs.com/getting-started/fixing-npm-permissions.
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.