npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

synced-folder-guard

v0.1.0

Published

Warns you BEFORE npm/pip/cargo installs corrupt inside a cloud-synced folder (Google Drive, OneDrive, Dropbox, iCloud). Stops EPERM/EBADF/TAR_BAD_ARCHIVE errors before they cost you an hour.

Downloads

134

Readme

synced-folder-guard

Stop wasting an hour on EPERM / EBADF / TAR_BAD_ARCHIVE errors. This tool warns you before you install packages inside a cloud-synced folder.

Running npm install (or pip, cargo, yarn, pnpm) inside Google Drive, OneDrive, Dropbox, or iCloud Drive is one of the most confusing failures in dev tooling. The sync client fights the package manager for the same files mid-write, and you get a wall of errors like:

npm warn tar TAR_BAD_ARCHIVE: Unrecognized archive format
npm warn tar TAR_ENTRY_ERROR EBADF: bad file descriptor, write
npm warn tar TAR_ENTRY_ERROR EPERM: operation not permitted, write
Error: Cannot find module 'ajv'

Every guide tells you the same thing — after you've already lost the time: "clear your cache, delete node_modules, move the project." synced-folder-guard flips that: it tells you before the install, in one second.

Install

npm install -g synced-folder-guard

Or run it once with no install:

npx synced-folder-guard

Usage

Check the current folder:

synced-folder-guard          # or the short alias: sfg

If you're safe:

OK  not in a cloud-synced folder: C:\Users\you\repos\my-app

If you're not:

WARNING  this folder is inside a cloud-synced location.

  Path:     G:\My Drive\repos\my-app
  Provider: Google Drive
    - Google Drive (folder name "My Drive")

  Installing packages here often fails or silently corrupts, with errors like:
    EPERM, EBADF, ENOENT, TAR_BAD_ARCHIVE, "Unrecognized archive format"

  Fix: move this project to a non-synced folder (e.g. a local repos dir),
       or pause syncing for the duration of the install.

Check a specific path:

synced-folder-guard "G:\My Drive\repos\my-app"

Guard your installs automatically

Add it as a preinstall script so a bad location can never bite you again:

{
  "scripts": {
    "preinstall": "synced-folder-guard --fail"
  }
}

With --fail, the install aborts (exit code 1) when the project lives in a synced folder.

Options

| Flag | Description | |------|-------------| | -f, --fail | Exit with code 1 if the folder is synced (use in preinstall) | | --json | Machine-readable JSON output | | -q, --quiet | Print nothing when the folder is safe | | --no-color | Disable colored output | | -h, --help | Show help | | -v, --version | Show version |

Use as a library

const { detect } = require('synced-folder-guard');

const result = detect(process.cwd());
// {
//   path: 'G:\\My Drive\\repos\\my-app',
//   synced: true,
//   matches: [{ provider: 'Google Drive', via: 'folder name "My Drive"' }]
// }

if (result.synced) {
  console.warn(`Heads up: ${result.matches[0].provider} folder detected.`);
}

What it detects

| Provider | How | |----------|-----| | Google Drive | My Drive, Shared drives, Google Drive, GoogleDrive-* (macOS CloudStorage) folder names | | OneDrive | $OneDrive / $OneDriveCommercial / $OneDriveConsumer env vars, and OneDrive / OneDrive - Company folder names | | Dropbox | Real folder location read from Dropbox's own info.json, plus the Dropbox folder name | | iCloud Drive | Mobile Documents / com~apple~CloudDocs folder names |

Detection is segment-boundary aware, so a folder like MyDropboxNotes is not a false positive.

Why this happens

Cloud sync clients use placeholder/virtual files and aggressively lock files to upload them. Package managers extract thousands of small files and rename them rapidly. When both touch the same file at the same moment, the write fails — sometimes loudly (EPERM), sometimes silently (a half-extracted tarball that breaks require later). The only reliable fix is to keep node_modules out of the synced folder entirely.

Zero dependencies

Pure Node, no runtime dependencies. Works on Windows, macOS, and Linux. Node >=16.

License

MIT