Nothing Prevents Misery

    clear-npx-cache
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    Why you should clear your NPX cache?

    NPX has a bug. When you call, for example, one of this:

    npx create-react-app
    npx cowsay "I'm a cow!"
    npx new-typescript-module

    …then you will do it successfully. But NPX will install it to your NPX cache, and NPX will not be watching lifetime of its cache. NPX package will be stored in the cache forever. When NPX-utility was updated, the cache will not be updated. I'll repeat, it's a bug.

    For users

    If you sometimes use a NPX-utility, you shall store an old version of this package in your cache. And every package update will not be seen by NPX. Cache clearing will solve this trouble.

    For developers

    If you are developing a new NPX-package, you will test it. But you can publish a bugful package, and after a fix and re-publishing you will see same bug. I want you shall not repeat my expirience in bug-finding and source-code-jumping.

    Usage

    npx clear-npx-cache

    Expected behavior:

    • Take a cache directory from NPM configuration (npm config get cache)
    • If in this directory exists _npx
      • Then remove it recursely
      • Otherwise create a new _npx directory

    Install

    npm i clear-npx-cache

    DownloadsWeekly Downloads

    2,383

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    3.65 kB

    Total Files

    6

    Last publish

    Collaborators

    • retueze