-
Notifications
You must be signed in to change notification settings - Fork 190
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
Permission issue on windows. #71
Comments
I am currently facing the issue. I had to run this command as administrator and it worked. However, now, I can't make
Do you think my issue is related to this one or I shall create another issue (and where, here or in yarn repo). |
This is causing problem as well, when using corepack with
|
NVM, I was being a dummy. I purged that |
Same as @ArnabXD |
@rikers Have you tried From my personal experience, don't apply "run as admin" to any programming tool on Windows/macOS, it is likely to break everything. Instead find the correct way to put them at current user's scope (%appdata% is such place). |
Yup, just like described in your initial message. |
Same issue here. Can't get past it |
I have the same issue, I am trying to upgrade the yarn from v1 to v3. |
I fixed the issue by installing the latest stable version node which is 16.15.0. |
I don't have a WIndows machine to test that, but my guess is that would indeed not trigger that EPERM error, but it also wouldn't make the scripts available on the path, so it wouldn't be much more useful. Can anyone tries this out? In any case, PRs are welcome. |
Yes, you're right. But installing to the same place as node.exe would also annoy many users when they don't run in sudo mode (they shouldn't). In fact, I was considering The main problem here is So here are some answers I guess to solve this issue:
Preknowledge: Permissions of Node.js on WindowsThe installer installs node.exe and npm.cmd to
|
Do you know if it's actually |
Although %localappdata% is perfered, in fact they are almost the same thing. Let me explain the 2 folders quickly: Windows has a tiny feature that it can sync program data automatically when it is put in %appdata%, but with some limitations: some file formats (.zip) don't get synced; total files' size bigger than some value will make the whole folder not get synced. That's why you can see many programs occasionally using %appdata% and/or %localappdata% without fear. To some extent they are the same. Nowadays programs won't rely on this place to sync settings, they should ask for storing data in OneDrive or require user login to save data to their database. In fact, Windows is considering deprecate this feature in the future. You can just treat them as 2 places that don't need admin permission to create and edit files. They are sort of |
For me the issue was that the freshly installed Node.js installation folder had explicit permissions set instead of inheriting them. Right click -> Properties -> Security -> Advanced -> Change permissions -> Enable inheritance solved the problem. |
Having to set Would the maintainers be okay accepting a contribution adding an environment variable to this effect? |
I had the same issue. When I googled the error, it seemed like many people people were running "corepack enable" by running their terminal using "Run as administrator." Not saying it's the right way to solve it, but it might be nice to have official guidance on this somewhere. |
how can we do this? |
(on windows 11) I just wanted to use a
Hope that helps :) |
If anyone is installing with WSL, make sure your wsl.conf contains the following. As WSL will use your Windows PATH env.
|
The node.js installer on windows (*.msi) will choose
C:\Program Files\nodejs
by default to place node.exe, npm and corepack. As you may know this place requires admin permission, the installer will bring up the UAC and ask for it once.At the same time, npm (and pnpm) works well here because it will install packages to
%appdata%\npm
, where no permission is needed.However, corepack will install pnpm to the same place as corepack by default (which is
C:\Program Files\nodejs\node_modules\corepack
. This causes permission issue:A workaround is using
--install-directory
to manually change the install folder to some place without permission, for example%appdata%\corepack
.I hope corepack would use places like
%appdata%\corepack
on windows to avoid potential EPERM issues.(BTW, the node.js installer for other systems are likely to choose a place with high permission. It is really an issue on macOS because it generally forbids installing anything globally, in which case users must use
brew
to correctly install it to a safe place. However I'm not expecting you to fix the installer logic and this is out of scope.)The text was updated successfully, but these errors were encountered: