View, download, and export
Need support with viewing, downloading, and exporting files and folders from your Dropbox account? Find help from the Dropbox Community.
Now create the same target node_moduels folder on each of your other systems **AFTER** Dropbox syncs the ENTIRE project direcotry. The old node_modules folder should be removed and the symlink (alias) added before running these steps.
🙂
..sebastian
NOTE: The Initial Post on this thread IS the Solution. While the technique specifically targets the node_modules folder in Javascript / TypeScript projects, it can also be applied to any "folders" that need to be ignored (see bottom of this post for a drag-n-drop technique).
HOW IT WORKS
Because Dropbox does not synchronize folders referened by symlinks (aliases), you can move those folders into a NON-DROPBOX path (outside of dropbox), then create a symlink (alias) in the original Dropbox location.
RESULT
The ignored folder in Dropbox looks and behaves as normal folder, but in reality the data lives in a non-synchronized location on the storage device.
HOW TO IGNORE ANY FOLDER (THE DRAG-N-DROP WAY)
NOTE: Using symlinks/aliases on Windows and Linux should behave the same way, but I have not verified it. Also, I've updated the original post to state that the tiny symlink (alias) file itself "IS" copied to all systems, but not the content of the folder.
..sebastian
Thank you for posting this idea!
The only thing is... where is this working? In OSX Dropbox is still syncing the symlinks.
NOTE: The Initial Post on this thread IS the Solution. While the technique specifically targets the node_modules folder in Javascript / TypeScript projects, it can also be applied to any "folders" that need to be ignored (see bottom of this post for a drag-n-drop technique).
HOW IT WORKS
Because Dropbox does not synchronize folders referened by symlinks (aliases), you can move those folders into a NON-DROPBOX path (outside of dropbox), then create a symlink (alias) in the original Dropbox location.
RESULT
The ignored folder in Dropbox looks and behaves as normal folder, but in reality the data lives in a non-synchronized location on the storage device.
HOW TO IGNORE ANY FOLDER (THE DRAG-N-DROP WAY)
NOTE: Using symlinks/aliases on Windows and Linux should behave the same way, but I have not verified it. Also, I've updated the original post to state that the tiny symlink (alias) file itself "IS" copied to all systems, but not the content of the folder.
..sebastian
I received a response from Tech Support explaining how to use the xattr command in terminal to ignore a file/folder (link below).
Are you a god?
I've been searching for a solution for several years! I wouldn't expect it to be as simple as a symlink. Kudos!
It does not work for me (on Windows). The first npm install is fine, the second run will basically delete the symlink, recreate the directory, add some packages and then fail with a file not found error 😞
Hi,
Thanks for the reply! It is the same machine.
It seems to work with yarn though, but I can't switch easily since other people work with the code (and lock file) too.
After switching to yarn, I've noticed that composer (the PHP package manager) also doesn't like if its directory ("vendor" in this case) is a symlink.
So at the moment, this trick does not work with NPM or composer.
@Arne1 , That's a bummer. I’ve definitely seen various commands on the toolchain not respecting symlinks and takes a bit of effort to figure it out. You might consider posting a question to the tool's project page asking for help getting symlinks working. If/When you find a workaround for your toolchain, please post it back here to help the rest of the developer community.
Until we have a .dropboxignore (a “true ignore”, without reindexing), sharing workarounds (hacks) are the only course of action. If a .dropboxignore feature existed, I’d put far more of my projects into Dropbox.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!