4

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?

sharataka
  • 5,014
  • 20
  • 65
  • 125

8 Answers8

12

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

Rizwan Atta
  • 3,222
  • 2
  • 19
  • 31
7

Had the same problem.

This worked for me:

  1. run whoami to get the current user.

  2. run: sudo chown -R ownerName: /path/to/node_modules

Idan Dagan
  • 10,273
  • 5
  • 34
  • 41
3

It looks like you have no permission- try this

sudo chmod -R 777 {path}

0

You can try having a look at these two examples:

  1. https://github.com/bower/bower/issues/2262
  2. Error: EACCES: permission denied

Also try running your terminal as an Administrator if possible.

Faisal
  • 104
  • 6
0

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
Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42
NadZ
  • 1,024
  • 9
  • 10
0

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

0

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

PauloBorba
  • 156
  • 3
  • 5
-2

Give permission to the .babel file

Suresh Tamang
  • 42
  • 1
  • 9