Keep node_modules out of cloud sync folders by linking them to a local cache. Cross-platform. Includes global npm setup command.
npm install node-linker-pronode_modules out of cloud sync folders by linking them to a local cache.
npm setup.
node_modules can be hundreds of MBs.
node-linker-pro moves your node_modules to a local cache folder outside
text
/Google Drive/MyProject
package.json
node_modules/ โ huge folder synced to the cloud
`
$3
`text
/Google Drive/MyProject
package.json
node_modules โ /Users/you/Library/Caches/node_modules_store/
`
โน๏ธ is a unique folder name based on your project path, ensuring no conflicts between different projects.
---
Features
- ๐พ Save cloud storage space.
- โก Faster project syncs.
- ๐ Cross-platform: macOS, Linux, Windows.
- ๐ฆ Works with npm, Yarn, and pnpm.
- ๐ Auto-installs missing dependencies.
- ๐ No changes to your package.json.
---
Installation
Install globally once:
`bash
npm i -g node-linker-pro
`
---
Usage
From any project folder:
`bash
npm setup
`
This will:
1. Move node_modules to the cache folder.
2. Create a symlink (mac/Linux) or junction (Windows).
3. Install dependencies if the cache is empty.
If your npm version doesnโt support npm setup:
`bash
npm-setup
`
---
Cache locations
| OS | Default cache path |
| ------- | ------------------------------------------------ |
| macOS | ~/Library/Caches/node_modules_store |
| Linux | ~/.cache/node_modules_store |
| Windows | %LOCALAPPDATA%\Temp\node_modules_cache |
Custom path:
`bash
mac/Linux
EXTERNAL_NODE_MODULES_DIR="/path/to/cache" npm setup
`
`powershell
Windows PowerShell
$env:EXTERNAL_NODE_MODULES_DIR="D:\path\to\cache"; npm setup
`
---
When to use it
โ
You keep projects in Google Drive, OneDrive, Dropbox, or iCloud.
โ
You want a cross-platform, cloud-safe workflow.
โ
You switch between multiple OSes and donโt want to re-download dependencies.
---
When not to use it
โ CI/CD pipelines (use npm ci instead).
โ Highly isolated builds requiring separate installs for security.
---
FAQ
Will it break my project?
No. Your tools see node_modules normally.
What if the cache is deleted?
Run npm setup` again โ dependencies will reinstall.