How to solve permission denied error with react native? - react-native

UPDATE:
In terminal I see this file has "-rw-r--r--". What command do I need to run in order to change this to the right permission?
I'm trying to run
react-native run-ios
and I keep getting the error shown below:
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/Users/sharatakasapu/Desktop/projects/albums/node_modules/.cache/#babel/register/.babel.7.2.2.development.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1299:33)
at save (/Users/sharatakasapu/Desktop/projects/albums/node_modules/#babel/register/lib/cache.js:52:15)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
I tried to follow along at why babel stores .babel.json in USERPROFILE path but didn't understand how to use this to solve the problem I have as I'm new to react. Any advice on how to address this?

About this i have seen this issue quite some time ago!
there can be too cases they might sound pretty lame though but bear with me and read!
1: the user profile you are using has no access to the files that are being targeted! or you might not have access to root node Packages! what you can do is
sudo chmod -R 777 /Users/sharatakasapu/{your node module path}
but the solution one seems a little trivial!
2: allowing your present user to read all cache and property files + folders! by doing
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
for more you can follow these links .
for solution 1: stackLink
for solution 2: githubLink

Had the same problem.
This worked for me:
run
whoami to get the current user.
run: sudo chown -R ownerName: /path/to/node_modules

It looks like you have no permission- try this
sudo chmod -R 777 {path}

You can try having a look at these two examples:
https://github.com/bower/bower/issues/2262
Error: EACCES: permission denied
Also try running your terminal as an Administrator if possible.

If you give permissions, your error must no longer be visible.
Generally on a MAC, the command is:
sudo chown YourName:staff /Users/YourName/.babel.json

anyone can move to project inside just move to ios folder there you can find your node module inside that check the path of every script and navigate them in terminal then try to use this command chmod 755 yourscriptname.sh

Note for my future self. An incompatible drive format might be the error:
"Permission Denied" in Node on Linux, when running start-script /w local nodemon/mocha/babel-node

Give permission to the .babel file

Related

neovim :PlugUpdate produces permission denied on all plugins

When entering in vim and then running :PlugUpdate all the plugins can't be updated because of the error
x <PLUGIN>:
error: cannot open .git/FETCH_HEAD: Permission denied
I was able to upgrade VimPlugin with :PlugUpgrade without any issues.
I was able to update this before without any issues about a month ago, I found an article saying that I need to change the ownership of the directory with chown which I am assuming would need to be done at $ sudo chown -R ~/.config/nvim/ but if I don't need to change owner then I'd prefer not to
I was able to resolve it by changing ownership with $ sudo chown -R $USER ~/.config/nvim/
note make sure to $ echo $USER to make sure that it's the user you wish to change the ownership of the directory

unable to chown files or directories from cifs/smb mount

Looking at several resources I have tried a variety of unsuccessful mount commands to try to be able to chown on a mounted smb/cifs share. My current iteration looks like this
sudo mount -t cifs //192.168.0.1/g /mnt/network -o user=user,uid=1001,gid=1001,vers=1.0,file_mode=0777,dir_mode=0777
followed by
sudo chown 1001:1001 /mnt/network/storage
This produces the following error that I can't seem to get around
chown: changing ownership of '/mnt/network/storage': Permission denied
I've tried gid=0,uid=0 anduser=root
Any insight into what I'm doing wrong or how to make this work would be much appreciated as so far what I've found online doesn't work, Thanks in advance!
I am running on ubuntu 21.04 and some raspberry pi's also running ubuntu (trying to access the same mounted directory which is on an external ssd)

The web server not permitted for chmod under WSL Ubuntu

I use Ubuntu 18 as WSL and everything was running well. Today I run the apache and started the application. When the app tried to perform chmod() on a file which was submited through form inside the folder project (I use Laravel), I received the following error:
chmod(): Operation not permitted
I have notice that this error happen when I try running chmod() from web server (www-data user). In the cli I dont have problems.
From other posts over the net, I understand that Windows has some changes regarding WSL permissions and drive mounts. But I didnt get answer or didnt succeed to resolve that issue.
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata
Reference: https://github.com/Microsoft/WSL/issues/3172#issuecomment-389157376
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=22,fmask=111
did the trick for me.
Ref: https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/

Permission Issues with ls command

I am a beginner. I have kept my nauty files in C:\cygwin\home\jim\n , I would like to use
ls
to see files in n,but I am getting error after
ls
coomand in cygwin.
$ ls
-bash: /usr/bin/ls: Permission denied
How can I solve the problem?
PS: Do I need to include any special package?

Error while executing gem...Permission Denied

I am attempting to install taps from my Heroku app folder. When I type "gem install taps," I get the following error:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24/bin/taps
I attempted to remove the taps-0.3.24 folder using rm -r and got this question: override rwxr-xr-x root/staff for /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema?
Upon typing yes, it tells me permission denied. Here is the whole exchange:
Jacob-MacBook-Pro:furious-ocean-6122012 jacob$ rm -r /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24/
override rwxr-xr-x root/staff for /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema? yes
rm: /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema: Permission denied
override rw-r--r-- root/staff for /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema.cmd?
Any thoughts on how to resolve this issue would be appreciated. Thanks!
I just ran into this when trying to get the Heroku Toolbelt running. I was able to remove the old version with sudo rm -rf /path/to/gems/taps-x.x.x and then re-install (without sudo).
You should add "sudo" before "gem...."