Closed matart15 closed 7 years ago
try sudo yarn install
, and post the yarn.log content
OK sudo did it.
Is sudo yarn
safe?. I mean its safe in react native but is it safe in general?
It's always better to run it without sudo
, but the fact that it has worked means that is not a yarn bug.
I assume that you are on Ubuntu or OSX. Try sudo chmod 0777 the-project-path
, and then remove the node_modules
path and theyarn.lock
file. Then run yarn
@rogervila does not working for me. I previous have .git in the-project-path, that command changed everything in my repo. So, It get worst.
But sudo chmod -R 777 node_module
just fine
@rogervila seems like few more people have same problem.
yarn install works with sudo. But npm install works on same folder without sudo. is it yarn problem? do you think it should be fixed?
@ziolau @matart15 Could you share your package.json
? I will try to reproduce it.
What OS version do you have?
for me i created brand new ignite project and tried to add react-native-camera.
{
"name": "App",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"lint": "standard --verbose | snazzy",
"lintdiff": "git diff --name-only --cached --relative | grep '\\.js$' | xargs standard | snazzy",
"fixcode": "standard --fix",
"clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean",
"newclear": "rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build/ModuleCache/* && rm -rf node_modules/ && npm cache clean && npm i",
"test": "NODE_ENV=production ava",
"test:watch": "ava --watch",
"coverage": "nyc ava && nyc report --reporter=html && open coverage/index.html || xdg-open coverage/index.html",
"tron": "node_modules/.bin/reactotron",
"android:build": "cd android && ./gradlew assembleRelease",
"android:install": "cd android && ./gradlew assembleRelease && ./gradlew installRelease",
"android:hockeyapp": "cd android && ./gradlew assembleRelease && puck -submit=auto app/build/outputs/apk/app-release.apk",
"android:devices": "$ANDROID_HOME/platform-tools/adb devices",
"android:logcat": "$ANDROID_HOME/platform-tools/adb logcat *:S ReactNative:V ReactNativeJS:V",
"android:shake": "$ANDROID_HOME/platform-tools/adb devices | grep '\\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} $ANDROID_HOME/platform-tools/adb -s {} shell input keyevent 82",
"flow": "flow --show-all-errors; test $? -eq 0 -o $? -eq 2"
},
"dependencies": {
"apisauce": "^0.5.0",
"format-json": "^1.0.3",
"querystringify": "0.0.4",
"ramda": "^0.22.1",
"react": "~15.3.0",
"react-native": "^0.36.0",
"react-native-animatable": "^0.6.0",
"react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git",
"react-native-config": "^0.1.0",
"react-native-device-info": "^0.9.5",
"react-native-drawer": "^2.3.0",
"react-native-i18n": "^0.1.1",
"react-native-maps": "^0.11.0",
"react-native-router-flux": "^3.35.0",
"react-native-vector-icons": "^2.1.0",
"react-redux": "^4.4.2",
"redux": "^3.6.0",
"redux-logger": "^2.4.0",
"redux-persist": "^3.5.0",
"redux-saga": "^0.11.1",
"reduxsauce": "0.2.0",
"seamless-immutable": "^6.1.0"
},
"devDependencies": {
"ava": "^0.16.0",
"babel-eslint": "^7.0.0",
"babel-preset-es2015": "^6.14.0",
"enzyme": "^2.3.0",
"flow-bin": "^0.33.0",
"ghooks": "^1.3.2",
"mockery": "^1.7.0",
"nyc": "^8.1.0",
"react-addons-test-utils": "^15.3.2",
"react-dom": "^15.3.2",
"react-native-mock": "^0.2.7",
"reactotron-apisauce": "^1.3.0",
"reactotron-react-native": "^1.3.0",
"reactotron-redux": "^1.3.1",
"snazzy": "^5.0.0",
"standard-flow": "^1.0.0"
},
"ava": {
"files": [
"Tests/**/*.js",
"!Tests/Setup.js"
],
"require": [
"babel-register",
"babel-polyfill",
"react-native-mock/mock",
"./Tests/Setup"
],
"babel": "inherit"
},
"standard": {
"parser": "babel-eslint",
"globals": [
"describe",
"it",
"fetch",
"navigator",
"__DEV__",
"XMLHttpRequest",
"FormData",
"React$Element"
]
},
"config": {
"ghooks": {
"pre-commit": "if [ -d 'ignite-base' ]; then cd ignite-base; fi; npm run lint"
}
}
}
Mac Sierra
npm -v : 3.10.9
node -v : v7.1.0
I tried it in an empty folder, and had no problems with:
As I can see, the error happens to you when it tries to access to AndroidManifest.xml
. Which service does need this file?
Maybe the error occurs after yarn and is related to ignite. Did you try to run yarn in an empty folder with only the package.json
?
These are Android build artfacts related to react-native. If you use a react-native package that requires Google Play Services, it looks like this issue comes up. You need to actually run Gradle for these to be downloaded (which is of course after Yarn runs).
The artifacts have a permission of -r-xr-xr-x
which yarn doesn't like. I'm not sure why the files Gradle downloads have that permission or why yarn needs to write to them.
This is my initial read of the issue. I haven't looked into it any further.
Ran into this issue myself with a React Native app as well.
Running cd ./android && ./gradlew clean
seems to clean up the EACCES issues for me.
i tried cd ./android && ./gradlew clean
one. But did not change. So i returned back to npm for now.
@rogervila / @ziolau opening up your project folder to everyone is not a very advisable solution.
chmod -R u+w /your/project/directory
Is probably the way to go. This makes your unix user (u
) have write access recursively (-R
) in your project directory. Instead of playing whackamole on each messed up permission, or blanket making all things world read-write-execute-able.
After installing nvm
for node versioning in Ubuntu 16.04 yarn install
threw EACCES errors.
I I tried sudo yarn install
with no success.
After mixing & matching various assets with sudo
and without. I get locked folders.
sudo chmod -R 777 path/to//project
and then yarn
or yarn install
seemed to do the trick.
I'll have to remove privileges later but I'll cross that bridge when I get there. Thanks
Getting this on ubuntu 16.04 in vagrant, yarn is trying to access my ~/.config/ folder which is set to drwx------
Not sure why it's locked down so tight, would rather open that though, than run yarn with sudo.
Just as a note to others - following @NexusInk's advice got me in all sorts of trouble. Change the permissions of all the files in a project broke all sorts of things including git. Had to figure out what the correct permissions were for all the src files, certain git internals etc. before I was able to get the project directory back in order. Not recommended.
Not sure what a better solution to this bug is though.
what @cdimitroulas is referring to is "file mode" in .git. Git tracks file permissions by default so you'll need to disable this or just commit the file permissions change to your repo, which may or may not be relevant
This method works mine. (MacOSX (Mojave))
I get this after running yarn upgrade-interactive
on a repo. Deleting yarn caches or node_modules
does not fix it, nor does chmod
or chown
.
The only solution I've found is to delete the entire repo and check it out again from git.
If you are using mac, you can try with homebrew.
brew install yarn
But
sudo chmod -R 777 node_module
just fine
How are these 'solutions' acceptable solutions?
This may be a little late, but here's an observation made recently after inheriting an old early 2011 macbook pro.
I'm a web dev, so I installed the node stack, but because this beaut is an old girl now, I can't rely on brew too heavily as I can only go up to macOS 10.13 now. Mostly manual installs.
So after doing so, noticed my /Users/[user]/.config
folder was permission set to root:staff
, probably a side effect of the install process, my best guess? Using sudo in the nvm installation (as directed) had some side effect.
Just note the file it's trying to access in the error message (mine was Error: EACCES: permission denied, open '/Users/tech1337/.config/yarn'
), which led me to the issue. I just did chown -R [user] ~/.config
and voilá!
Hope this helps someone out there!
Had similar issue, so I installed yarn globally and then ran sudo yarn, and it did the trick.
It's always better to run it without
sudo
, but the fact that it has worked means that is not a yarn bug. I assume that you are on Ubuntu or OSX. Trysudo chmod 0777 the-project-path
, and then remove thenode_modules
path and theyarn.lock
file. Then runyarn
In my case it was sufficient to remove the node_modules & yarn.lock and run 'yarn', the permission change or sudo wasn't necessary.
Could the problem have been caused because I moved the files on folder up after the initial installation?
remove all yarn files; then, npm install -g yarn
In my case the reason was that I was running yarn via package.json -> scripts
and npm run
and apparently the npm developers thought it was a good idea to change the effective user id (without logging a message, without changing the home directory, without even checking if the user exists) when running scripts.
sudo npm i yarn --global
Works for me
sudo npm i yarn --global
It works for me too. thank you.
sudo npm i yarn --global
It works for me too. thank you.
sudo npm i yarn --global
works like a charm
It's always better to run it without
sudo
, but the fact that it has worked means that is not a yarn bug. I assume that you are on Ubuntu or OSX. Trysudo chmod 0777 the-project-path
, and then remove thenode_modules
path and theyarn.lock
file. Then runyarn
In my case, I've deleted node_modules and yarn.lock and run yarn add [libToInstall] and it works. Thank you
Just as a note to others - following @NexusInk's advice got me in all sorts of trouble. Change the permissions of all the files in a project broke all sorts of things including git. Had to figure out what the correct permissions were for all the src files, certain git internals etc. before I was able to get the project directory back in order. Not recommended.
Not sure what a better solution to this bug is though.
Easy generic way to get most permissions fixed: find . -type f -exec chmod 644 '{}' \; && find . -type d -exec chmod 755 '{}' \;
You could also just rm -rf your local copy and re-clone.
If you do the permissions fix, once you have files at 644 and directories at 755, you can make adjustments as needed for your project.
Do you want to request a feature or report a bug? bug
What is the current behavior? react native project
yarn install
gives me this errorI tried chmod 777 the file. but error is same even there is 777 permission
Please mention your node.js, yarn and operating system version. npm -v : 3.10.9 node -v : v7.1.0