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 does not support workspaces #5895

Closed
2 tasks done
remcohaszing opened this issue Nov 25, 2022 · 0 comments · Fixed by #5932
Closed
2 tasks done

[BUG] npm completion does not support workspaces #5895

remcohaszing opened this issue Nov 25, 2022 · 0 comments · Fixed by #5932
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release

Comments

@remcohaszing
Copy link

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

When running npm completion from an npm workspace, it shows the following error:

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

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/remco/.cache/npm/_logs/2022-11-25T10_09_50_122Z-debug-0.log
logs
0 verbose cli /usr/bin/node /home/remco/.local/bin/npm
1 info using npm@9.1.2
2 info using node@v18.12.1
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/home/remco/.local/lib/node_modules/npm/npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 info found workspace root at /home/remco/Projects/vscode-mdx
10 timing config:load:file:/home/remco/Projects/vscode-mdx/.npmrc Completed in 0ms
11 timing config:load:project Completed in 9ms
12 timing config:load:file:/home/remco/.npmrc Completed in 1ms
13 timing config:load:user Completed in 1ms
14 timing config:load:file:/home/remco/.local/etc/npmrc Completed in 0ms
15 timing config:load:global Completed in 0ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 16ms
18 timing npm:load:configload Completed in 16ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm completion
22 verbose argv "completion"
23 timing npm:load:setTitle Completed in 1ms
24 timing config:load:flatten Completed in 1ms
25 timing npm:load:display Completed in 2ms
26 verbose logfile logs-max:10 dir:/home/remco/.cache/npm/_logs/2022-11-25T10_09_50_122Z-
27 verbose logfile /home/remco/.cache/npm/_logs/2022-11-25T10_09_50_122Z-debug-0.log
28 timing npm:load:logFile Completed in 1ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 21ms
32 silly logfile start cleaning logs, removing 2 files
33 timing config:load:flatten Completed in 0ms
34 timing command:completion Completed in 0ms
35 verbose stack Error: This command does not support workspaces.
35 verbose stack     at Completion.execWorkspaces (/home/remco/.local/lib/node_modules/npm/lib/base-command.js:102:25)
35 verbose stack     at Npm.exec (/home/remco/.local/lib/node_modules/npm/lib/npm.js:184:31)
35 verbose stack     at async module.exports (/home/remco/.local/lib/node_modules/npm/lib/cli.js:133:5)
36 verbose cwd /home/remco/Projects/vscode-mdx/packages/language-server
37 verbose Linux 6.0.6-76060006-generic
38 verbose node v18.12.1
39 verbose npm  v9.1.2
40 error code ENOWORKSPACES
41 error This command does not support workspaces.
42 verbose exit 1
43 timing npm Completed in 30ms
44 verbose code 1
45 error A complete log of this run can be found in:
45 error     /home/remco/.cache/npm/_logs/2022-11-25T10_09_50_122Z-debug-0.log

Expected Behavior

npm completion just works as usual when inide a workspace.

Steps To Reproduce

  1. Navigate to a workspace inside an npm mono repo.
    git clone git@github.com:npm/cli.git
    cd cli/workspaces/arborist
  2. Run npm completion
  3. See error

Environment

  • npm: 9.1.2 (also happened in npm 8)
  • Node.js: v18.12.1
  • OS Name: Pop!_OS
  • System Model Name:
  • npm config:
; "user" config from /home/remco/.npmrc

cache = "/home/remco/.cache/npm" 
init-author-email = "remcohaszing@gmail.com" 
init-author-name = "Remco Haszing" 
init-license = "MIT" 
prefix = "/home/remco/.local" 

; node bin location = /usr/bin/node
; node version = v18.12.1
; npm local prefix = /home/remco
; npm version = 9.1.2
; cwd = /home/remco
; HOME = /home/remco
; Run `npm config ls -l` to show all defaults.
@remcohaszing remcohaszing added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Nov 25, 2022
@fritzy fritzy removed the Needs Triage needs review for next steps label Dec 7, 2022
@wraithgar wraithgar added the Priority 2 secondary priority issue label Dec 7, 2022
wraithgar added a commit that referenced this issue Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants