2๐
I got around this error by changing permissions for two directories:
Set permissions to Everyone โ Read / Write for
- /usr/local/lib/node_modules
-
/usr/local/bin
- Open Finder.
- Press Command +Shift+G. A dialog box opens.
- Enter the path and click Go
- Right-click the directory and select Get Info
- Click the lock icon to allow changes and enter your credentials
- In the Sharing & Permissions section change everyone to Read & Write
- Click the cog icon and select Apply to enclosed items from the drop down
- Confirm the prompt
Reference Article:
https://forum.vuejs.org/t/vue-cli-installation-fails-on-macos-mojave-10-14/45712/5
1๐
As far as I know, its not just a Vue Cli issue but can happen for any node module.
Often this happens if you installed NPM as an administrator or using Sudo. You can usually get around it by doing something like sudo npm install xxx-package-xxx
But that really just compounds the problem down the road when lots of things need elevated privileges.
In my case uninstalling and re-installing Node + NPM with a new package (not the ones included with MacOS) kind of helped but I eventually ended up nuking my OS and installing everything fresh.