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

[BUG] npm completion throws This command does not support workspaces. #5486

Open
2 tasks done
b-fett opened this issue Sep 8, 2022 · 2 comments
Open
2 tasks done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@b-fett
Copy link

b-fett commented Sep 8, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

No response

Expected Behavior

No response

Steps To Reproduce

  • change working directory to some workspace
  • run npm completion
  • observe error message

Environment

  • npm -v: 8.19.1
  • node -v: v16.15.0
@b-fett b-fett added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Sep 8, 2022
@GerkinDev
Copy link

GerkinDev commented Oct 19, 2022

This has been the case for quite some time. Minimal repro here: https://github.com/GerkinDev/npm-completion-error

This makes npm very poorly usable in workspaces configuration in plumbing mode, at least for zsh. The issue can be somewhat mitigated in zsh by disabling plumbing mode & statically loading completion with something like:

source <(cd $HOME && npm completion)

Doing the above in the profile file effectively disable completion entirely in workspace packages, but at least, the error is gone.

Note: the cd ensure that you're not in a workspace package before running the command.

Unfortunately, with nvm, this becomes way less interesting.

Hope this gets fixed.


Full error & keywords (for people using Google like I did without finding anything for so long):

npm ERR! code ENOWORKSPACES
npm ERR! This command does not support workspaces.

zsh completion workspace

@dorianclay
Copy link

Was this fixed by this fix: ignore implicit workspaces for completion (#5932)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

3 participants