Vue-cli: Permission issue when install on windows: npm install -g @vue/cli

Created on 3 Aug 2018  路  16Comments  路  Source: vuejs/vue-cli

Version

3.0.0-rc.10

Node and OS info

node v9.11.1/ npm 5.6/ windows 10

Steps to reproduce

run command npm install -g @vue/cli

What is expected?

expect to install vue-cli

What is actually happening?

C:\WINDOWS\system32>npm install -g @vue/cli
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\is-accessor-descriptor\node_modules'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\extend-shallow\node_modules'
npm WARN [email protected] requires a peer of graphql@^0.11.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli' -> 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue.cli.DELETE'
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli' -> 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue.cli.DELETE'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli' -> 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue.cli.DELETE'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli',
npm ERR! dest: 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\.cli.DELETE' },
npm ERR! stack: 'Error: EPERM: operation not permitted, rename \'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli\' -> \'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\.cli.DELETE\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\cli',
npm ERR! dest: 'C:\Users\106319\AppData\Roaming\npm\node_modules\@vue\.cli.DELETE' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\106319\AppData\Roaming\npm-cache_logs\2018-08-03T15_09_24_281Z-debug.log

Most helpful comment

@dewitt-li (and anyone who may face this issue and come here) I managed to solve that problem by doing the following:

npm cache verify #I tried running npm cache clean but it wasn't necessary
npm i -g @vue/cli@latest

All 16 comments

Same as me (except that I use a different OS and more up-to-date versions of Node and NPM).
Cf.: #2061

This is not caused by Vue CLI itself, but try clearing your npm cache, and uninstall previous version before installing again.

@dewitt-li (and anyone who may face this issue and come here) I managed to solve that problem by doing the following:

npm cache verify #I tried running npm cache clean but it wasn't necessary
npm i -g @vue/cli@latest

@Berkmann18 I tried the same commands but no luck, still running into the same error.

@dewitt-li Have you tried doing any of the following commands?

npm cache clean
npm-check -gu #or if you don't have that package then npm up or npm -g npm@latest
npm i -g vue-cli@latest

@Berkmann18 The commands installed 2.9 instead of version 3 which what I need

@Berkmann18 It's the antivirus software. Worked as soon as it is stopped. It's also noticeably faster.

@dewitt-li Ah okay.

@Berkmann18 It's the antivirus software. Worked as soon as it is stopped. It's also noticeably faster.

Have the same problem, but can't turn off the antivirus. Cleaning npm cache or running as admin doesn't help.

vue-issue

why this error coming all time when i try to create new project

@dewitt-li (and anyone who may face this issue and come here) I managed to solve that problem by doing the following:

npm cache verify #I tried running npm cache clean but it wasn't necessary
npm i -g @vue/cli@latest

can you please help me. I tried everything

I can confirm that disabling McAfee antivirus resolved the issue on my system.

FYI, if npm won't work give yarn a try

@akhil-c-k Seems like you tried to install it with sudo or su then running it without.
Try re-installing it without root permissions.

@dewitt-li (and anyone who may face this issue and come here) I managed to solve that problem by doing the following:

npm cache verify #I tried running npm cache clean but it wasn't necessary
npm i -g @vue/cli@latest

This worked for me, thanks!

Was this page helpful?
0 / 5 - 0 ratings