antfu-collective / taze

🥦 A modern cli tool that keeps your deps fresh
MIT License
2.83k stars 86 forks source link

-g option for global packages #63

Open phenomen opened 1 year ago

phenomen commented 1 year ago

Clear and concise description of the problem

There is no way to check updates for packages installed in a global scope (npm/pnpm install * -g).

Suggested solution

Add -g option to check/write updates for packages installed globally.

Alternative

No response

Additional context

No response

Validations

andrewspy commented 1 year ago

Doesn't seem to support pnpm currently.

simexce commented 1 year ago

The loadGlobalPnpmPackage method throws an exception

81

Current environment

  1. The pnpm version is 8.8.0.
  2. taze version is 0.11.3.
  3. The output of command pnpm ls --global --depth=0 --json is
    [
    {
        "path": "C:\\Users\\simexce\\AppData\\Local\\pnpm\\global\\5",
        "private": false
    }
    ]

Reason pnpmOut => Object.entries(pnpmOut.dependencies),pnpmOut.dependencies is undefined.

touhidurrr commented 6 months ago

Also, does not work on Node 22 when taze is installed with bun. taze is installed with npm works.

PS C:\Windows\System32> taze -g
TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at loadGlobalNpmPackage (file:///C:/Users/User/.bun/install/global/node_modules/taze/dist/cli.mjs:942:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async checkGlobal (file:///C:/Users/User/.bun/install/global/node_modules/taze/dist/cli.mjs:850:22)
    at async Object.handler (file:///C:/Users/User/.bun/install/global/node_modules/taze/dist/cli.mjs:1060:18)