Margaret C
Margaret C

Reputation: 1

Error for installing latest vue-cli npm ERR! code EACCES npm ERR! syscall mkdir npm ERR! path /usr/local/lib/node_modules/@vue

I tried to install vue-cli on my vscode, I ran this command: npm install -g @vue/cli

this is what my terminal shows:

~ % npm install -g @vue/cli npm ERR! code EACCES npm ERR! syscall mkdir npm ERR! path /usr/local/lib/node_modules/@vue npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@vue' npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@vue'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'mkdir', npm ERR! path: '/usr/local/lib/node_modules/@vue' 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 this file 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.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/*****/.npm/_logs/2023-05-03T03_54_58_307Z-debug-0.log

what can I do in this case?

I tried to change the owner and its not working.

Upvotes: 0

Views: 310

Answers (1)

timray
timray

Reputation: 628

EACCES errors can occur on recent versions of MacOS because security has been tightened.

Try following the steps here to re-install npm with a node version manager which should stop these errors from happening: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

Upvotes: 0

Related Questions