Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EACCES: permission denied, unlink

Tags:

reactjs

I can't launched my project with react.js with command yarn install. Get error:

error /Users/lera/Desktop/beam-web/node_modules/sharp: 
Failed to auto-install node-gyp. Please run "yarn global add node-gyp" manually. 
Error: "EACCES: permission denied, 
unlink '/Users/lera/.config/yarn/global/node_modules/.yarn-integrity'"

npm 5.0.3. node 8.1.4. yarn 0.24.5 macOS Sierra 10.12.4

When I launched command again it installs packages, but after command yarn run devit shows following:

Cannot find module '../build/Release/sharp.node'

I tried to add sharp by yarn add sharp, but receive the same error. EACCES: permission denied

like image 720
Valeria Shpiner Avatar asked Jul 18 '17 12:07

Valeria Shpiner


People also ask

What might be causing the error error Eacces Permission denied access '/ usr local lib Node_modules '?

This means you do not have permission to write to the directories npm uses to store global packages and commands. Try running commands: sudo chmod u+x -R 775 ~/. npm and sudo chown $USER -R ~/. npm or you can just run any npm command with sudo , that should get resolve your issue.


3 Answers

First of all, you need to check permission by running the command:

ls -la ~/.config/yarn/global/node_modules/.yarn*

I received the next response:

-rw-r--r-- 1 root staff 15163 Jul 18 15:17 ~/.config/yarn/global/node_modules/.yarn-integrity

Then if you saw that root had permission, but you don't have, you should add permission to yourself:

sudo chown -R ${USER} ~/.config/yarn/
like image 146
Valeria Shpiner Avatar answered Oct 27 '22 08:10

Valeria Shpiner


Change permissions for files, folders, or disks on Mac Permission settings determine who can view and alter files on the computer. You change permission settings at the bottom of the Info window for a file, folder, or disk in the Finder. For example, you can change permission settings for a folder so that other users who log in to your Mac, or connect to it for file sharing, can view but not change files in a folder.

The permission settings at the bottom of an Info window. Assign permissions to users and groups On your Mac, select a disk, folder, or file, then choose File > Get Info.

If the information in Sharing & Permissions isn’t visible, click the arrow .

If the lock at the bottom right is locked , click it to unlock the Get Info options, then enter an administrator name and password.

Click a user or group in the Name column, then choose a privilege setting from the pop-up menu.

Read & Write: Allows a user to open the item and change it.

Read only: Allows a user to open the item, but not change its contents.

Write only (Drop Box): Makes a folder into a drop box. Users can copy items to the drop box, but can’t open it. Only the owner of the drop box can open it.

No Access: Blocks all access to the item.

You can undo any changes to privilege settings for a user or group in the Sharing & Permissions section since opening the Info window. Before closing the Info window, click the Action pop-up menu , then choose “Revert changes.”

Apply permissions to all items in a folder or a disk On your Mac, select a folder or disk, then choose File > Get Info.

If the lock at the bottom right is locked , click it to unlock the Get Info options, then enter an administrator name and password.

Click the Action pop-up menu , then choose “Apply to enclosed items.”

Change an item’s owner On your Mac, select the item, then choose File > Get Info.

If the lock at the bottom right is locked , click it to unlock the Get Info options, then enter an administrator name and password.

If the new owner’s name isn’t listed in the Name column in the Sharing & Permissions section, click the Add button to add the new owner.

Select the new owner in the Name column, click the Action pop-up menu , then choose “Make __ the owner.”

You can undo any changes to an item’s owner in the Sharing & Permissions section since opening the Info window. Before closing the Info window, click the Action pop-up menu , then choose “Revert changes.”

Add or remove a user or group in the Name column On your Mac, select an item, then choose File > Get Info.

If the lock at the bottom right is locked , click it to unlock the Get Info options, then enter an administrator name and password.

In the Sharing & Permissions section, do any of the following:

Add a user or group: Click the Add button below the list, select a user or group, then click Select.

Remove a user or group: Select the user or group, then click the Remove button below the list.

You can undo adding or removing a user or group in the Sharing & Permissions section since opening the Info window. Before closing the Info window, click the Action pop-up menu , then choose “Revert changes.”enter image description here

like image 29
Mubaraka Mubahood Avatar answered Oct 27 '22 10:10

Mubaraka Mubahood


I tried with sudo yarn to get privilege. Its worked for me.

try sudo yarn instead yarn install.

like image 44
Hannan Avatar answered Oct 27 '22 10:10

Hannan