You Have No Write Permissions For This Directory Mac

When you create a file or folder in OS X, the system initially does not know what permissions it should set, so it attempts to apply full read, write, and execute access (number 7 shown above. 'The file 'name.app' couldn't be open-end because you don't have permissions to view it.' As we known, each file and folder contains the permission, and there are four permissions: Read & Write, Read only, Write only, No Access on macOS. Usually we can change the file privilege with Get Info or command + I operation. @JensErat you don't need write permissions to edit a file in place. But some gui editors write to a temp file in the same folder, and if that works they delete the old file and rename new to old. THAT process requires write-to-parent folder. – paul Jun 24 '15 at 0:27.

Jan Miller writes:

I have six computers and use a Mac mini as a fileserver with sharing set up on it. About every week some of the files become read-only for some of the users.

You Have No Write Permissions For This Directory Macbook

Apple does offer a $20 upgrade for macOS that lets you turn a Mac into a more full-featured server, including better controls for folder access. However, it requires a bit more system. I tried both of these options with no luck. I can save to the desktop. But no other drives. (there are 6 different drives) Is there somewhere in windows to configure the read and write settings other that the properties panel for each individual drive?

She also asks:

When I open the files on one computer two servers show up with the same info in each.

But her request for both is the same: “How do I make this more reliable?”

The first problem is a limitation with the underlying Unix system upon which macOS is built upon+. Many operating systems have the concept of “file permissions,” which are metadata attributes set for each file and folder (or directory) about who may create, manipulate, and delete items, as well as who may execute or run them as software. Permissions are designed to compartmentalize users and prevent non-privileged users from accessing administrative functions.

Unix generally divides permissions in user, group, and “world,” meaning all other users of the system for read, write, execute, and a few extras typically needed only by system files. Apple adds extended file attributes on top of this that can be used by apps or the system.

But despite all the control over who can do what, there’s shockingly no way to lock permissions for a given folder such that everything created in it, modified in it, or added to it inherits the permissions of the parent folder. That is, you’d expect you could say, “Shared Folder should always be reachable for everyone who has access to this system,” and yet there’s no simple way to ensure that.

Over at StackExchange, a contributor came up with a long command-line invocation you can use in Terminal to set a folder to keep permissions set correctly, but it only works when files are created in the folder—if you move a file or multiple items in, they don’t inherit the right permissions. If you’re comfortable with the Terminal, this will certainly reduce the problem but not get rid of it.

Apple does offer a $20 upgrade for macOS that lets you turn a Mac into a more full-featured server, including better controls for folder access. However, it requires a bit more system-administration knowledge. The book Take Control of OS X Server ($20) may help. It was last updated for El Capitan (OS X 10.11), but little changed.

Now the second question, why two servers appear, is easier:

  1. Make sure all users have disconnected from the file server, clicking the eject button next to the server name in the sidebar of the Finder on their Macs.
  2. On the Mac sharing files, open the Sharing system preference pane.
  3. Select File Sharing.
  4. Click Options.
  5. You should see both Share Files and Folders Using SMB and another item for AFP checked. Uncheck AFP.
  6. Click Done.

You should no longer see two servers. Apple supports AFP (Apple Filing Protocol) for legacy reasons, but has put its new file-sharing efforts behind SMB, which is compatible with Mac, Windows, and other platforms.

If you find that some older Macs can no longer connect to the server, you may need to re-enable AFP, even with the duplicate servers appearing.

Ask Mac 911

We’ve compiled a list of the questions we get asked most frequently along with answers and links to columns: read our super FAQ to see if your question is covered. If not, we’re always looking for new problems to solve! Email yours to mac911@macworld.com including screen captures as appropriate. Mac 911 can’t reply to—nor publish an answer to—every question, and we don’t provide direct troubleshooting advice.

Note: When you purchase something after clicking links in our articles, we may earn a small commission. Read ouraffiliate link policyfor more details.

    Related:
Glenn Fleishman is the author of dozens of books. His most recent include Take Control of Your M-Series Mac, Take Control of Securing Your Mac, Take Control of Zoom, and Six Centuries of Type and Printing. In his spare time, he makes Tiny Type Museums. He’s a senior contributor to Macworld, where he writes Mac 911.

The first time you try to install a package globally using npm, using the syntax npm install -g <package> on a Mac, or Linux, you might get a weird error, saying something like

or something along those lines, followed by a long list of other errors of warnings, a consequence of the first error that’s printed to you.

This error is preventing us to install the package.

You Have No Write Permissions For This Directory Machine

How do you fix this? It’s a permission error, which means you don’t have write access to that folder.

This is how to solve it. Run this command:

You Have No Write Permissions For This Directory Mac

Let’s break it down:

sudo means we are running this command as root, the system super user. This is because we don’t have permission to write to that folder, but root will be able to fix any permission. This command also means the system will ask for your password to confirm.

chown is the command we use to change the owner of a file or folder. We set the -R option to change the owner recursively, so we also get owner access to all the files already contained in there.

$USER is an environment variable automatically set to your username.

And the final piece is the folder path.

Running this path will make the folder yours, so you can safely run your npm install -g <package> commands!

Pay attention to the folder listed by the error message. If it’s different, update the chown command accordingly.

You have no write permissions for the directory macDirectory

This tip applies to single user systems. On a multi-user system, you might want to create a dedicated directory for npm modules, see https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally.

Download my free Node.js Handbook and check out my Node.js Masterclass!