yarn error "EACCESS: permission denied, scandir '/home/ubuntu/.config/yarn/link'" - node.js

Whenever I try something with yarn on Ubuntu 16.04 server.
It gives an error.
I am currently using nodejs v8.10.0
yarn install v1.5.1
error An unexpected error occurred: "EACCES: permission denied, scandir '/home/ubuntu/.config/yarn/link'".
info If you think this is a bug, please open a bug report with the information provided in "/home/ubuntu/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Anyone know why this is happening?

It's likely a unix permission related problem. There is a solution posted on the dev's github page. Try to run the following command
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
Reference: EACCES: permission denied .config/configstore/bower-github.json #2262

I had this problem as well, I found on another thread that my config folder was owned by root, which created several permissions issues.. I changed owner to my user and this error went away.
See top answer on this thread
Unable to access 'git/attributes'

Related

Error: EACCES: permission denied NPM Ubuntu Server

I am running an Ubuntu EC2 server and followed the tutorial provided by AWS to install nvm and node, but when I try to run npm install, I'm thrown an error:
Error: EACCES: permission denied, access '/var/www/app'
Please try running this command again as root/Administrator.
The standard procedure with an EC2 Ubuntu service appears to only provide a ubuntu user with sudo privileges and no access to root so I tried to run sudo npm install, but I receive sudo: npm: command not found. The reason why I believe this is happening is because nvm is located at /home/ubuntu/.nvm/versions/node/v6.12.3/bin/node, which root might not have access to?
Is it possible to point root to the this directory location for this command or is there a different solution?
You're getting that error because you do not have write permission for your user on that /var/www/app.
You can follow the answer here to give permissions to that folder.
https://askubuntu.com/questions/749697/how-do-i-give-myself-access-to-var-www-to-create-and-edit-files-and-folders-in
You are getting the error about npm not being installed when you use sudo because it is not installed for the admin user. I would avoid installing node and npm through sudo though. Just go with changing the folder permissions.

npm WARN checkPermissions Missing write access

I have been trying to fix the issue of running node without using sudo on my mac but I keep getting this message:
npm WARN checkPermissions Missing write access to /Users/myuser/.npm-packages/lib/node_modules/npm
And still find no fix for that. Has anyone seen this issue before?
This is a known bug, even now with npm 6.14 available.
Here it is a link to npm.community.
You can give current user permission to access node_modules using this in terminal:
sudo chown -R $USER /usr/local/lib/node_modules
and then npm install.
OK I found what was wrong.
I tried to open the /Users/myuser/.npm-packages/lib/node_modules/npm folder on finder to see if I could change the folder permissions but it seemed like the npm folder was pointing to some non-existing directory.
So I removed the npm symbolic link and created a new empty npm folder and everything seems to be working now.
Works for me on Ubuntu:
sudo chown -R $USER /usr/local

EACCES, permission denied when running bower

For some reason my bower does not work when I run bower on the command line. It was working before, and all of a sudden it just stopped working
Everytime I type bower I keep getting this error message on the terminal
EACCES: permission denied, open '/Users/eldanshkolnikov/.config/configstore/bower-github.json'
I am not sure what this means??
I reinstalled bower and node.. and I am still getting this error message.. any help would be really appreciated.
I figured the issue.
I cd into the .config/ folder and changed the chown user from root to my username eldanshkolnikov
I was still having issues after... so I cleared tall the bower cache by going to
~/.cache/
and deleting all contents in the bower folder which did the trick

trying to run "brew uninstall node"

because my npm and node are giving me grief and I want to rinstall them.
Here is the message I get:
Permission denied - /usr/local/Cellar/node/0.10.32/include/node/libplatform/libplatform.h
what's with the Permissions denied?
Sometimes the permissions and/or ownership records can get messed up. Try following the instructions here or running the uninstall again with sudo.

nodejs fs eacces permission

I've just run into a strange problem with fs reading a file.
I have node application run from a deployment manager (strongloop strong-pm) as the following user "strong-pm".
No matter what permissions I give to the file I'm trying to open throug the node app, I get
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
worker:1 Error: EACCES, permission denied '/root/my_dir/file.txt'
at Object.fs.openSync (fs.js:432:18)
at Object.fs.readFileSync (fs.js:286:15)
I've tried everything:
sudo chown -R strong-pm:strong-pm /root/my_dir
sudo chmod -R 777 /root/my_dir
sudo chmod 777 /root/my_dir/file.txt
adding the strong-pm to a group
then adding that group to the directory...
Still no luck.. any ideas?
Thanks!
System: Ubuntu 14.04 x64 on DigitalOcean
Rather than trying it inside node, try to switch to that user and read the file:
su strong-pm
cat /root/my_dir/file.txt
If that works, make sure node is running using that user.
Try this:
.{otherPATH}/root/my_dir/file.txt
It seemed like the issue was that the /root directory was protected and so subdirectories were not accessible by node somehow

Resources