Reputation: 3295
Well, i see that already have many questions related to my problem on this site, but i also see that NONE of the solutions work for my specific case, because of that, i am opening that question, so it is not a duplicate.
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject"
},
"dependencies": {
"@expo/vector-icons": "^9.0.0",
"expo": "^32.0.0",
"lodash.clonedeep": "^4.5.0",
"native-base": "^2.10.0",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-native-credit-card-input": "https://github.com/itspauloroberto/react-native-credit-card-input.git",
"react-native-password-strength-meter": "https://github.com/itspauloroberto/react-native-password-strength-meter.git",
"react-native-responsive-screen": "^1.2.0",
"react-native-scalable-image": "^0.5.0",
"react-navigation": "^3.0.9",
"react-redux": "^6.0.0",
"redux": "^4.0.1",
"redux-form": "^8.1.0",
"redux-saga": "^0.16.2",
"url-join": "^4.0.0",
"vanilla-masker": "^1.2.0"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0"
},
"private": true
}
My problem is when i try to run the following command expo start
or npm start
that is the same.
I HARDLY BELIEVE THAT IS A OS PROBLEM because last week i was using the same project on another os elementary-os
and i had not any problems!
Then i get this error when i execute expo start
or npm start
:
Uncaught Error { [Error: EACCES: permission denied, open '/home/itspauloroberto/.expo/state.json.354451305']
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/home/itspauloroberto/.expo/state.json.354451305' }
nvm install 10.15.1
npm install expo-cli
expo init
.expo start
.First of all, i have sure that this project/application runs ok, because i had another OS (elementaryOS) on last week and i was working on the project with no problems, also i have a team that works on it with no problems also.
node
and npm
and also the expo-cli
.rm -rf node_modules
and npm install
.package.lock.json
and npm install
again.nvm
node version manager, (and i am using it atm).chown myuser project-folder
to give my user access to the folder (tried on .expo folder and node_modules folder also)chmod 777 and 755 and 655
the whole project folder.expo start
, npm start
command with sudo
prefix but sudo cannot find expo
or neither npm
.git clone
again.Also there is no SELinux involvement as you can see below:
ls -ld
drwxr-xr-x 2 itspauloroberto itspauloroberto 4096 Feb 20 14:54 .
Because of that i am creating this question, even if i see this error on many of the website none have my context.
Upvotes: 16
Views: 21100
Reputation: 21
Often when you see an error like :
Uncaught Error Error: EACCES: permission denied, open '/Users/r/.expo/state.json.728296139'
you can try running the command again except with sudo in front of it.
For example, the error below:
expo init my-app
Uncaught Error Error: EACCES: permission denied, open '/Users/r/.expo/state.json.728296139'
Can be solved with:
$ sudo expo init my-app
Password:
Upvotes: 0
Reputation: 138
I had this issue because I had been working with cmd
locally, and bash in an Ubuntu WSL2 sub-system.
I must have installed some packages from the ubuntu terminal, so besides for deleting a .expo
file from my WSL home directory, I had to delete my node_modules
file, and run npm install
from my windows-cmd console.
Upvotes: 1
Reputation: 1144
uninstall expo first. then uninstall npm and reinstall npm and then expo
Upvotes: 0
Reputation: 3295
The main reason was because, in some moment, i used sudo
to install something related to expo, then expo created some files that belongs to the root
user in another directory that was not on the project folder that i am working.
So it was because the initial files by expo on the very initial install of expo was installed using sudo
apparently, because the files inside this directory: home/itspauloroberto/.expo
and also the folder was owned by root
(i checked it using la -ls
command and saw root
as the owner.) instead of my user itspauloroberto
that was the main source of the error.
home/your_user/
directory..expo
folder using sudo rm -rf .expo
(sudo needed because the folder owner is root)expo start
If you find any additional errors related to some directory or file, navigate to the file/directory that is on the error message and delete it. Because it should belong to root
user also.
Upvotes: 44