[for discussion] move default localStorage location under $HOME
See original GitHub issuei ran into a problem when trying out your cash project. With my nodejs/npm setup, global installs require sudo: sudo npm i -g cash
however, because of that, cash doesn’t have permissions to write to its own localstorage directory:
$ cash
fs.js:794
return binding.mkdir(pathModule._makeLong(path),
^
Error: EACCES: permission denied, mkdir '/Users/tenaciousmv/npm/lib/node_modules/cash/node_modules/vorpal/dist/.local_storage'
obviously i don’t want to run cash with sudo 😃
isn’t it more typical to put this kind of storage in ~/.vorpal or ~/.cash or somewhere else under $HOME?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:11 (5 by maintainers)
Top Results From Across the Web
LocalStorageExport default storage location - HowTo
On your computer, open Chrome. · At the top right, click More. Settings. · At the bottom, click Advanced. · Under the “Downloads”...
Read more >Chrome 61: Local Storage Location Changed? - Super User
James Amos, you'll right, new place location storage is *.ldb file. %localappdata%\Google\Chrome\User Data\Default\Local Storage\leveldb see ...
Read more >Prevent Access to Local Storage via Developer Tools?
No, you can't. Even if there is a temporary 'solution' or hack that seems to work, it is still the web, so there...
Read more >LocalStorage and SessionStorage | Web Storage APIs
SessionStorage and LocalStorage are known as the web storage API. Data can be stored on the client side by using these APIs. SessionStorage:....
Read more >Cannot choose or change local storage path on Windows 10 ...
First approach · Create a local "Storage" and give it a name · Go to general settings · Go to "Import" · In...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For reference, this is how yarn does it:
So,
getCacheDirectory()returns$HOME/.cache/yarnon Linux,%LOCALAPPDATA%\Yarn\cacheon Windows, and$HOME/Libarary/Caches/Yarnon macOS.I think something like that would be a good option for vorpal.
I know this is an old issue, but I just found it, while trying to figure out where this was stored.
I think using
os.tmpdir()isn’t a good idea, as, on some OSs (like Linux), this may default to a volatile directory. These files may not persist after a reboot.I think the original suggestion of it being somewhere in the home directory is better. There’s frequently a
.cachedirectory in $HOME. That’s where, e.g.,yarnstores its module cache.