unjs / nypm

🌈 Unified Package Manager for Node.js and Bun
MIT License
439 stars 13 forks source link

support adding workspace dependencies #52

Closed danielroe closed 1 year ago

danielroe commented 1 year ago

Environment

pnpm v8

Reproduction

Reproducible with https://github.com/nuxt/nuxt/pull/20126 by running pnpm nuxi devtools enable playground

Describe the bug

Using addDependency does not support adding -w flag for pnpm.

 ERR_PNPM_ADDING_TO_ROOT  Running this command will add the dependency to the workspace root, which might not be what you want - if you really meant it, make it explicit by running this command again with the -w flag (or --workspace-root). If you don't want to see this warning anymore, you may set the ignore-workspace-root-check setting to true.

 ERROR  corepack pnpm add -D @nuxt/devtools failed (exit code: 1)                                                                                                              16:07:08

  at ChildProcess.<anonymous> (node_modules/.pnpm/nypm@0.1.0/node_modules/nypm/dist/index.cjs:200:23)
  at ChildProcess.emit (node:events:513:28)
  at ChildProcess.emit (node:domain:489:12)
  at ChildProcess._handle.onexit (node:internal/child_process:291:12)

Additional context

No response

Logs

No response

pi0 commented 1 year ago

Nice spot! PR welcome to add workspace: true (yarn also needs it)