Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: loadGlobalPnpmPackage throws TypeError #81

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

simexce
Copy link
Contributor

@simexce simexce commented Sep 28, 2023

Filter pnpmOuts

Description

An error occurred while running taze -g with the following error message.

TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at file:///D:/scoop/persist/nvm/nodejs/v16.20.1/node_modules/taze/dist/cli.mjs:819:25
    at Array.map (<anonymous>)
    at loadGlobalPnpmPackage (file:///D:/scoop/persist/nvm/nodejs/v16.20.1/node_modules/taze/dist/cli.mjs:818:29)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 1)
    at async checkGlobal (file:///D:/scoop/persist/nvm/nodejs/v16.20.1/node_modules/taze/dist/cli.mjs:749:22)
    at async Object.handler (file:///D:/scoop/persist/nvm/nodejs/v16.20.1/node_modules/taze/dist/cli.mjs:978:18)

The error occurs because the dependencies field is missing, because you get the following result when running pnpm ls --global --depth=0 --json.

[
  {
    "path": "C:\\Users\\simexce\\AppData\\Local\\pnpm\\global\\5",
    "private": false
  }
]

Therefore, the filtering operation is performed on pnpmOuts.

Linked Issues

#63

Additional context

  1. pnpm version is 8.8.0 .
  2. taze version is 0.11.3 .

@simexce simexce mentioned this pull request Sep 28, 2023
3 tasks
@antfu antfu merged commit 857ff0c into antfu-collective:main Oct 2, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants