0
votes

I am trying to install Vue-CLI.

npm install -g @vue/cli

But i have lots of errors.

npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/lib/node_modules'] {
npm ERR! stack: "Error: EACCES: permission denied, access'/usr/lib/node_modules'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access thisfile as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

I tried to reinstall nodejs & npm and I also tried to updtate code-js to 3 version, but that didn't work out.

2
did you try running as sudo - looks like you don't have permissions to the node_modules folder. You can run it as sudo or give yourself permissions to said folderMike Diglio
Do not run as sudo! Fix where npm is trying to install global packages by following the instructions on npm's website: Resolving EACCES permissions errors when installing packages globally. Running as sudo will give you even more issues down the line.zero298
Does this answer your question? npm command - sudo or not?zero298

2 Answers

1
votes

try npm uninstall vue-cli

then npm install @vue/cli this is to install vue and upgrade to Vue 3 cli

0
votes

Run npm install -g @vue/cli as a root user.

sudo npm install -g @vue/cli