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

Add support for the workspace: protocol #173

Closed
goestav opened this issue Jun 22, 2024 · 1 comment · Fixed by #177
Closed

Add support for the workspace: protocol #173

goestav opened this issue Jun 22, 2024 · 1 comment · Fixed by #177
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@goestav
Copy link
Contributor

goestav commented Jun 22, 2024

I'm using a PNPM workspace for my project but when I use the workspace: protocol with the pnpm attw --pack . command I get the following error:

error while checking file:
Command failed: npm pack

Running npm pack manually reveals the following in the debug file:

14 verbose stack TypeError: Cannot set properties of null (setting 'peer')
14 verbose stack     at visit (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js:101:54)
14 verbose stack     at visitNode (/opt/homebrew/lib/node_modules/npm/node_modules/treeverse/lib/depth-descent.js:58:25)
14 verbose stack     at next (/opt/homebrew/lib/node_modules/npm/node_modules/treeverse/lib/depth-descent.js:44:19)
14 verbose stack     at depth (/opt/homebrew/lib/node_modules/npm/node_modules/treeverse/lib/depth-descent.js:83:10)
14 verbose stack     at depth (/opt/homebrew/lib/node_modules/npm/node_modules/treeverse/lib/depth.js:27:12)
14 verbose stack     at unsetFlag (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js:96:5)
14 verbose stack     at /opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js:63:7
14 verbose stack     at CIMap.forEach (<anonymous>)
14 verbose stack     at calcDepFlagsStep (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js:41:17)
14 verbose stack     at calcDepFlagsStep (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js:38:12)
15 error Cannot set properties of null (setting 'peer')

I currently use pnpm attw $(pnpm pack) as workaround but it would be nice if the --pack option used the same package manager.
This could be detected automatically with a package like detect-package-manager or passed manually as an option.
Yarn seems to use this protocol too for workspaces.

@andrewbranch andrewbranch added feature New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 27, 2024
@andrewbranch
Copy link
Collaborator

I would accept a PR adopting detect-package-manager!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants