skip to Main Content

I was installing Vue.js in my system using npm i -g @vue/cli but this happened:

 npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\Users\pc\AppData\Roaming\npm\node_modules\@vue\cli\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:UserspcAppDataRoamingnpmnode_modules@vueclinode_modulesapollo-server-core'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\Users\pc\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\apollo-server-core'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\Users\pc\AppData\Roaming\npm\node_modules\@vue\cli',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:UserspcAppDataRoamingnpmnode_modules@vueclinode_modulesblnode_modulesreadable-streamlib'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\Users\pc\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\bl\node_modules\readable-stream\lib'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\Users\pc\AppData\Roaming\npm\node_modules\@vue\cli',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:UserspcAppDataRoamingnpmnode_modules@vueclinode_modulesnode-notifier'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\Users\pc\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\node-notifier'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code EEXIST
npm ERR! path C:UserspcAppDataRoamingnpmvue.cmd
npm ERR! EEXIST: file already exists
npm ERR! File exists: C:UserspcAppDataRoamingnpmvue.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in: C:UserspcAppDataLocalnpm-cache_logs2023-10-11T13_06_03_205Z-debug-0.log

I’m really new to Vue.js and worked only in React and NextJs. Can anyone with any knowledge of it help me resolve this problem?

2

Answers


  1. Installing modules globally tends to require admin access, which you aren’t running your command with.

    You seem to be following out of date documentation.

    The official documentation for Vue does not recommend that approach.

    Instead use:

    npm create vue@latest
    

    What’s more, the documentation for @vue/cli says:

    Vue CLI is now in maintenance mode. For new projects, please use create-vue to scaffold Vite-based projects. create-vue supports both Vue 2 and Vue 3.

    (The above command is how you use create-vue).

    Login or Signup to reply.
  2. The error message you are seeing indicates that npm is trying to remove some directories, but is unable to do so due to permission errors. It is also trying to create a file called vue.cmd, but that file already exists.

    There are a few possible reasons for this error:

    • You are trying to install npm packages as root, but you do not have permission to delete the directories in question.
    • You have another application running that is using the directories in question.
    • There is a problem with the permissions on the directories in question.

    To fix this error, you can try the following:

    • Try running npm as a regular user, instead of as root.
    • Close any other applications that may be using the directories in question.
    • Check the permissions on the directories in question and make sure that the current user has permission to delete them.
    • If you are still having problems, you can try running npm with the --force option. This will overwrite the existing directories and file, even if you do not have permission to do so.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search