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
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:
What’s more, the documentation for @vue/cli says:
(The above command is how you use create-vue).
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:
To fix this error, you can try the following:
--force
option. This will overwrite the existing directories and file, even if you do not have permission to do so.