Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How to Find and Delete Old node_modules Folders on a Mac

Yes—you can safely delete node_modules folders in inactive projects on macOS. Every package inside node_modules can be reinstalled later with npm install , yarn , pnpm install , or bun install as long as your package.json and lockfile are intact. If you build side projects or use AI coding tools like Claude Code, Cursor, or Codex, node_modules folders pile up quickly across dozens of folders and…

To safely remove outdated node_modules folders from a Mac, first determine how much space they occupy. Using the command "find ~ (-path ~/Library -o -path ~/.Trash -o -name .git) -prune -o -type d -name node_modules -prune -exec du -sh {} +" will list the largest top-level node_modules directories in your home folder. This should be run with caution, as it could accidentally delete important directories if not used correctly.

Next, identify which projects are safe to clean. Any project with a node_modules folder not modified in the last 60 days can be considered safe for deletion. Running the command "find ~/Projects -name node_modules -type d -prune -mtime +60 -exec du -sh {} +" will show the size of each project's node_modules folder. Again, this should only be done after confirming that the project is not currently in use.

Node_modules should not be deleted in active projects or projects that track dependencies in Git. Projects using pnpm may also require special attention, as they use a shared store to minimize duplication. In these cases, running "pnpm store prune" can help reclaim space.

When deleting node_modules, it's best to use the "rm -rf" command to move the folder to the Trash rather than deleting it permanently. This allows for easy recovery if needed. Alternatively, npm kill can be used to interactively delete dependencies from a specific project.

After deleting node_modules, it's necessary to re-install project dependencies using the appropriate npm, yarn, pnpm, or bun command. This ensures that all required packages are restored to their latest versions.

While deleting node_modules can free up significant disk space, the immediate impact may not be noticeable. This is often due to space being temporarily reserved in the Trash or due to specific behaviors of package managers like pnpm. Therefore, it's important to manage expectations and allow some time for the space to be reclaimed.

In summary, deleting old node_modules folders on a Mac is a safe and effective way to reclaim disk space, provided that the projects are not currently in use and the package.json and lockfiles are intact. Always exercise caution when running cleanup commands and verify that the necessary dependencies will be re-installed before proceeding.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

Is Xcode DerivedData Safe to Delete? What Happens and How to Clean It

Yes—Xcode's DerivedData folder is safe to delete. Xcode automatically regenerates everything inside it the next time you open and build a project.

  • Deleting Xcode's DerivedData folder won't affect source code or Git history.
  • Regeneration of DerivedData contents may take longer after deletion.
  • CleanBit tool helps selectively clean Xcode storage safely.

Writing a Prompt That Holds a First-Person Camera Steady for 30 Seconds

Most AI video prompts describe a scene. A POV prompt has to describe a camera — and that is a harder problem than it looks. The usual failure mode is not a bad scene. It is drift.

  • Camera behavior specified as strict invariants to prevent drift
  • Prompt includes role, setting, lighting, and anchor frames
  • Starts with three still frames meeting deny-list criteria

MiniMax H3-Image: Native 4K at 16.8MP in Six Steps - Three ComfyUI Workflows Compared

MiniMax H3-Image: native 4K at 16.8 megapixels in six sampling steps (three ComfyUI workflows) MiniMax's H3-Image is unusual for one reason: it does not upscale its way to a big picture.

  • MiniMax H3-Image generates 4K resolution images (16.8MP) directly.
  • Three ComfyUI workflows compared for different purposes.
  • JSON files available on RunningHub for testing.

Running a Community Native PC Port of The Last of Us Remastered on Windows

I spent an evening getting a community-built native PC port of The Last of Us Remastered running on Windows 11, and almost all of the friction came from desktop hygiene rather than the game: an…

  • Windows 10 or 11 with admin privileges required
  • 7-Zip, VC++ 2015–2022 x64, updated GPU driver needed
  • Extract archive, monitor for build issues, run via batch file

*/5 in crontab: cron every 5 minutes

*/5 in a crontab means every five minutes. The full line is */5 * * * * . It runs at minute 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 of every hour — locked to the clock, not to the minute you…

  • The /5 notation in crontab executes a task every five minutes.
  • The complete cron line is /5 .
  • Manually copy the expression into the crontab on the scheduled machine.

New BMW i7 Launched in Pakistan

Dewan Motors has introduced the facelifted BMW i7 50 xDrive LCI in Pakistan, showcasing the updated all-electric luxury sedan in … Read More The post New BMW i7 Launched in Pakistan appeared first on…

More from Saturday 21 November →