-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Windows fails with EPERM: operation not permitted, all files are read-only #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is Yarn marking |
Hi @Daniel15 Could you please try this in a clean directory?
The last command gives me:
I'm not sure if it's something the firebase packages does? |
For clarification; I tried the same steps but with react and eslint and didn't see the same error. |
Thanks for the information! I can replicate the issue on Windows but not on Debian Linux. |
I would say this is more of a critical error as it prevents even basic use of Yarn in any project using Removing read-only flag recursively works, but only temporarily. Even running just Creating fresh project with |
Yes this is quite annoying. @Daniel15 |
That would kinda erase usefulness of Yarn, don't you think? Removing those read-only flags makes Yarn do whole linking process again. Only performance save would about using cache instead of downloading over the network every time. |
@FredyC I fail to see how a postinstall script erases yarns usefulness? It's still most likely multiple times faster than npm when installing, and has a lock file. If that makes yarn unpreferable for you, I would think yarn is not preferable anyways in its current form? |
Encountering this as well. Nothing special about my project, I'm just getting around it by blowing out my Hopefully this resolves soon, thank goodness yarn is so damned fast! ;) |
Well this is interesting. If you download actual tarball of the firebase module, those read-only attributes are already there! ... https://registry.npmjs.org/firebase/-/firebase-3.4.1.tgz That means it's not exactly Yarn fault. I assume that what NPM does differently is to actually remove that flag upon installation. Essentially that might be solution that Yarn should do as well because you never know what other module can be affected like that. I've actually tried to publish my own package to NPM with read-only flag set on the one file. Sadly that's not the source of the problem. Files are published without the flag. So I've filed support request with Firebase to see if there is something they can change in their publishing process. |
Can we hope that in future Yarn release this case will be dealt with, using NPM approach or otherwise. Just a FYI, it will also work if you remove firebase first, then add your required packages and at last add firebase back. So is Yarn updating the permissions when firebase is removed? |
@vijay-stayntouch No, Yarn does nothing about it. Main problem is that if you have firebase there with read only flags and the "linking dependencies" process has to be executed for some reason, it is unable to touch these files and fails. Although I am bit unsure how it's possible that Yarn can actually delete those files with read-only flags. |
Hey, Firebase engineer here. We are going to fix this on our end by making sure our next release no longer contains read-only files. That being said, this does seem like unexpected behavior and probably should get fixed across the board for Yarn, as it is in npm. Thanks! |
Is this the same issue as #872? |
Good news to everyone who has trouble with this. There is a new firebase module 3.6.2 without read only flags and it works flawlessly now. I recommend closing this one in favor of #961 which is more generic and related to Yarn only. |
@FredyC Great news! The question still hangs up in the air that if any other packages makes their code read-only. The same issue will happen again. |
@vijay-stayntouch Yea, that's what #961 should try to solve really. |
I have the same issue with
I'm do a |
I was getting the same issue - the only solution that worked for me was to use |
* Fix: make sure all extracted tarballs are r/w enabled **Summary** Fixes: #992. This issue was supposed to be fixed by #2826 but it was not setting directory permissions wide enough. This patch uses the `readable` and `writable` options provided by the `tar-fs` package which essentially sets everything to `0o777`. **Test plan** N/A * fewer perms
* Fix: make sure all extracted tarballs are r/w enabled **Summary** Fixes: yarnpkg#992. This issue was supposed to be fixed by yarnpkg#2826 but it was not setting directory permissions wide enough. This patch uses the `readable` and `writable` options provided by the `tar-fs` package which essentially sets everything to `0o777`. **Test plan** N/A * fewer perms
On Windows, be sure to run the Command Prompt "As Administrator". ::facepalm:: |
Tried everything listed here - the only way I was able to fix it was: npm install -g rimraf
rimraf node_modules as suggested by @domjtalbot. |
happens to me too, npm 5.8.0, and the only one working is pointed by @domjtalbot and @James-E-Adams |
I run into the same issue when I have a server running with |
@rmorrise +1, would be logical if |
For info: I had the same issue after cancelling the installation of a package (ctrl+c), and trying to install another package afterwards. I also had a server running but it didn't cause errors when I added other packages before. |
I've had the same problem. The reason caused this bug was running create-react-app development server in ubuntu for windows bash. Stopping the server solved the problem. |
At least for me, this seems to be caused by having vscode open. |
Make sure your app(angular, react, etc...) is turned off before |
I can't believe this works thank you for your solution |
@Gameghostify me either 😄 You're welcome. |
Check if you have a node process running, shut if off and try again |
I was running yarn from a vscode terminal so I restarted vscode and that did the trick |
IT REALLY WORKED. THANK YOU. |
@Gayathri-K-2000 Can you provide more details please? I'm facing same issue but didn't work. Please provide example of what you did if possible. Thank you! |
I unchecked 'read only' from properties of node modules and ran in cmd as administrator. It works. |
That indeed was my problem here as well. Same goes for react apps, e.g. when you are prompted to install |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When performing any operation with yarn (add for instance) it errors with:
If the current behavior is a bug, please provide the steps to reproduce.
To fix the issue, right click the node_modules folder and un-check "Read-only". Wait. Re-run yarn command. Now it works, like magic! After yarn is done, all files are back to being read-only though.
What is the expected behavior?
Shouldn't have to mark the files as readable.
Please mention your node.js, yarn and operating system version.
node v6.3.1
yarn v0.15.1
Windows 10 (anniversary edition)
The text was updated successfully, but these errors were encountered: