Prevent iCloud from Syncing "node_modules" Folder

To use:

  • npm install -g icloud-nosync-node
  • nosync-node or nsn
  • -n flag will prevent it from creating/modifying .gitignore file

The script does a few things to work:

  • Step 1: if no node_modules is detected it will npm install for you
  • Step 2: Rename node_modules to node_modules.nosync
  • Step 3: Add symlink node_modules -> node_modules.nosync so stuff still works
  • Step 4: Add entry to .gitignore to ignore the newly created node_modules symlink and node_modules.nosync
  • Step 5: 💰💰💰?

A good alternative would be to store all your development files locally instead of iCloud Drive...rookie mistake.

Popular posts from this blog

Party-ify emojis to gif