-
Notifications
You must be signed in to change notification settings - Fork 463
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
XDG_DATA_HOME is not respected under macOS #622
Comments
I should have changed the name of the feature. It is not If you think this is the wrong choice, please reopen. Thanks for the input 🙏 |
In macOS environment, XDG_DATA_HOME does not exist, so there is no problem to use the path under Library as the default fnm folder. And it will affect almost no one except developers who explicitly want to use XDG_DATA_HOME on macOS. However, if the XDG_DATA_HOME environment variable exists, my recommendation is to uniformly honor this. Because some developers work in cross-platform environments, they may set this environment variable themselves and potentially use unified dotfiles to ensure consistency across environments. They expect all data files to be located under ~/.local for easy management. I hope you understand this usage requirement and reduce fragmentation of fnm behavior, thanks. It seems that I cannot reopen the issue on my own. |
didn't know that. sorry. I understand your frustration, but I also agree with dirs-dev/directories-rs#47 (comment) that being said, maybe it's time to have a |
it's worth to mention that I do not like to use |
Thank you for pointing out the related discussion. I respect your choice and understand your intentions. I as a developer respect the default folder location of the platform and use it, but also respect the user. BTW, I'm also using macOS 12.1 but made changes to the file path and do not use the default location. No wonder I didn't notice the recently mentioned TMPDIR problem. 🤣🤣🤣 |
@Schniz This issue seems to break Using default install through homebrew. $ npx forever ./foo
node:events:371
throw er; // Unhandled 'error' event
^
Error: spawn /Users/user/Library/Application EACCES
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -13,
code: 'EACCES',
syscall: 'spawn /Users/user/Library/Application',
path: '/Users/user/Library/Application',
spawnargs: [
'Support/fnm/node-versions/v16.9.0/installation/bin/node',
'/Users/user/baz/bar/foo'
]
} |
This issue is about XDG_DATA_HOME not being respected, not related to the recent default installation location changes. Perhaps you are looking for a different PR or issue. ( PR number 416) |
Sorry for the noise, then – just switched over from In any case, installing manually with |
Thanks for sharing the solution. Maybe it will help others. I don't like the idea of installing command line programs by default to a path location like Application Support with spaces in it. Because you don't know when something weird will happen. |
I will try to take a look at that. I agree that Application Data is not a good idea. That still sounds odd that it fails though. Since we introduced a Do you have a suggestion on how you think it should work? 🙏 |
data_dir():
fnm dir:
For fnm default location, or keep it as is, let the users change the location by themselves. |
@Schniz Are you interested in a PR with support for XDG conventions on macOS? |
About space in the path ( vv@my-precious ~/work/own/reard/new-reard/api $ npm help dedupe
[
'man',
[
'/Users/vv/Library/Application Support/fnm/node-versions/v18.16.0/installation/lib/node_modules/npm/man/man1/npm-dedupe.1'
]
]
/usr/bin/man: line 413: cd: /Users/vv/Library/Application: No such file or directory
npm ERR! help process exited with code: 1
npm ERR! A complete log of this run can be found in: /Users/vv/.npm/_logs/2023-05-08T17_27_25_690Z-debug-0.log
vv@my-precious ~/work/own/reard/new-reard/api $ This happens due to a bug in |
I've created #959 to address this issue. I've chosen a different approach than @page-down suggested. I don't think it's a good idea to half-ass XDG conventions because the users who're not familiar with it might be confused as to why In addition, |
Support for $XDG_DATA_HOME was added in a recent release, however it is not used under macOS and falls back to the default location
~/Library/Application Support
.fnm 1.29.1
However $XDG_DATA_HOME is respected under Linux.
The XDG_DATA_HOME environment variable should be used first if it is configured, and then fall back to the macOS location.
For example, the changes to the install script in Pull Request 614.
#614
The text was updated successfully, but these errors were encountered: