sync Archives - Justin Silver https://www.justinsilver.com/tag/sync/ Technology, Travel, and Pictures Mon, 29 Aug 2016 05:25:30 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.1 https://www.justinsilver.com/wp-content/uploads/2013/06/cropped-apple-touch-icon-160x160.png sync Archives - Justin Silver https://www.justinsilver.com/tag/sync/ 32 32 Ignore node_modules in Dropbox https://www.justinsilver.com/technology/osx/ignore-node_modules-dropbox/?utm_source=rss&utm_medium=rss&utm_campaign=ignore-node_modules-dropbox https://www.justinsilver.com/technology/osx/ignore-node_modules-dropbox/#comments Mon, 29 Aug 2016 04:38:35 +0000 https://www.justinsilver.com/?p=4233 Node is notorious for generating a rather large number of files in the node_modules when running and npm install. I like to start my projects in Dropbox, which presents a problem with my computer...

The post Ignore node_modules in Dropbox appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

Node is notorious for generating a rather large number of files in the node_modules when running and npm install. I like to start my projects in Dropbox, which presents a problem with my computer tries to sync tens of thousands of files, sometimes every few minutes if I’m working on a new module for example.

The solution for this problem is to the the “selective sync” feature of Dropbox, however it’s easiest if you haven’t already installed all the module dependencies. First, you want to create your project folder – either a directory followed by npm init, or possibly an existing project from a git or other source code repository.

In this example I will clone my node developer-tools module, which installs binaries and other tools for development work. This module can be found on Github here: https://github.com/doublesharp/node-developer-tools. It will be cloned into the path ~/Dropbox/Workspaces/node-developer-tools. After the directory has been created, we will manually create a node_modules folder inside it.

mkdir -p ~/Dropbox/Workspaces
cd ~/Dropbox/Workspaces
git clone https://github.com/doublesharp/node-developer-tools.git
mkdir -p ./node-developer-tools/node_modules

Now we can exclude this folder from Dropbox sync before filling it up with thousands of tiny files.

1. Select the dropbox icon from you system bar

2. Select the gear icon, followed by Preferences…

dropbox-node-1

3. Choose the Account tab

4. Find the Selective Sync option and click Change Settings…

dropbox-node-2

5. Navigate to Workspaces/node-developer-tools and un-select node_modules

6. Click the Update button

dropbox-node-3

Now you can install the node modules without having the sync to Dropbox.

Unfortunately this needs to be set up for each Node project you want to work with, but the up front investment will save time down the road. Plus a little storage space.

The post Ignore node_modules in Dropbox appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/osx/ignore-node_modules-dropbox/feed/ 2