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] ci command says I can get more info, but I can't #2857

Closed
ocket8888 opened this issue Mar 11, 2021 · 14 comments
Closed

[BUG] ci command says I can get more info, but I can't #2857

ocket8888 opened this issue Mar 11, 2021 · 14 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@ocket8888
Copy link

ocket8888 commented Mar 11, 2021

Current Behavior:

to figure out what the ci command does, I tried npm ci --help, which outputs

npm ci

Usage:
npm ci

aliases: clean-install, ic, install-clean, isntall-clean

Run "npm ci help" for more info

So, to figure out what is meant by a "clean" install, I tried to get "more info" using npm ci help. However, ci doesn't actually support the help sub-sub-command. If you try to do that, you wind up actually running a clean install as if you had just done npm ci.

Expected Behavior:

There are two possibilities. One is to actually support npm ci help by outputting a more detailed help message. The other is to simply remove the last two lines of output from npm ci --help, so that it is accurate.

I favor the former, because I still don't know what a "clean" install is - can anyone tell me?

Steps To Reproduce:

  1. npm ci --help
  2. Follow the instructions that outputs to try to obtain more information.

Environment:

                   -`                 
                  .o+`                 ocket8888@system76
                 `ooo/                 OS: Arch Linux 
                `+oooo:                Kernel: x86_64 Linux 5.11.5-arch1-1
               `+oooooo:               Uptime: 41m
               -+oooooo+:              Packages: 1520
             `/:-:++oooo+:             Shell: zsh 5.8
            `/++++/+++++++:            Resolution: 3840x2160
           `/++++++++++++++:           DE: KDE 5.79.0 / Plasma 5.21.2
          `/+++ooooooooooooo/`         WM: KWin
         ./ooosssso++osssssso+`        GTK Theme: Breeze [GTK2/3]
        .oossssso-````/ossssss+`       Icon Theme: breeze-dark
       -osssssso.      :ssssssso.      Disk: 315G / 932G (36%)
      :osssssss/        osssso+++.     CPU: Intel Core i7-9750H @ 12x 4.5GHz [42.0°C]
     /ossssssss/        +ssssooo/-     GPU: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
   `/ossssso+/:-        -:/+osssso+-   RAM: 5622MiB / 31818MiB
  `+sso+:-`                 `.-/+oso: 
 `++:.                           `-/+/
 .`                                 `/

Node version: v15.11.0
NPM version: 7.6.2

@ocket8888 ocket8888 added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Mar 11, 2021
@DeeDeeG
Copy link

DeeDeeG commented Mar 12, 2021

The message is fixed in the most-recent npm v7.6.3. That version was released ~17 hours ago, so it's very new.

The npm ci --help command now correctly tells you to run the npm help subcommand:

% npm ci --help
npm ci

Usage:
npm ci

aliases: clean-install, ic, install-clean, isntall-clean

Run "npm help ci" for more info

Particularly:

Run "npm help ci" for more info

Was fixed in this PR, apparently: #2855

@ljharb ljharb closed this as completed Mar 12, 2021
@ocket8888
Copy link
Author

Well, that command works, but it also doesn't really give me any more information:

Top hits for "ci"
————————————————————————————————————————————————————————————————————————————————
npm help package-json                                                      ci:76
npm help install                                                           ci:73
npm help config                                                            ci:62
npm help package-lock-json                                                 ci:24
npm help exec                                                              ci:17
npm help scripts                                                           ci:16
npm help npx                                                               ci:15
npm help update                                                            ci:14
npm help ls                                                                ci:13
npm help ci                                                                ci:13
————————————————————————————————————————————————————————————————————————————————
(run with -l or --long to see more context)

Did you mean this?
    ci

That is: I still have no idea what a "clean" install is.

@ljharb
Copy link
Contributor

ljharb commented Mar 12, 2021

npm help ci outputs that?

@ocket8888
Copy link
Author

Yeah:
image

@ljharb ljharb reopened this Mar 12, 2021
@DeeDeeG
Copy link

DeeDeeG commented Mar 12, 2021

I just tested this in Manjaro in a VirtualBox VM... Seems like Arch may have inadvertently broken npm help somehow for npm 7.

  • ✅ npm 6 works (from the Manjaro package repositories); It can do npm help ci just fine. It displays an interactive (scrollable, searchable) manpage just like it does for me on macOS.
  • ❌ npm 7 doesn't work (also from the Manjaro package repositories); It prints the message @ocket8888 posted above.

npm help ci is working for me on macOS and Ubuntu, regardless of npm/node version. (Tested with npm6/npm7 x node12/node15).

I think this is a bug or early-adopter issue with how Arch is packaging npm 7. I understand Arch Linux does some things to make npm and node work a bit different, more like system packages that depend on system libraries.


For context/to clarify: Arch offers npm as a system package: https://archlinux.org/packages/community/any/npm/

In my testing, that version of npm 7 has broken npm help.

@DeeDeeG
Copy link

DeeDeeG commented Mar 12, 2021

If you do this on Arch, you can see the manpage as it's meant to be displayed:

  • mkdir get_npm_as_a_module && cd get_npm_as_a_module && npm init -y
  • npm install npm@7
  • npx npm help ci

So, npm as it's published to the npm package registry is fine and not broken. Only the custom Arch-packaged version of npm 7 is broken in my testing.

@DeeDeeG
Copy link

DeeDeeG commented Mar 12, 2021

@ocket8888 npm ci is a lot like npm install, with a few key differences. It's pretty well-documented here: https://docs.npmjs.com/cli/v7/commands/npm-ci

@ljharb
Copy link
Contributor

ljharb commented Mar 12, 2021

@DeeDeeG in that case, it seems like a bug should be filed on arch, since npm does not officially distribute itself anywhere but it’s own install script or the npm registry itself.

@DeeDeeG
Copy link

DeeDeeG commented Mar 12, 2021

Arch Linux has a bug tracker, with the bugs for their custom npm package viewable here: https://bugs.archlinux.org/?project=5&string=npm

Link to file a new bug (I assume you need an account at their site to do so): https://bugs.archlinux.org/newtask?project=5&product_category=33&item_summary=%5Bnpm%5D+PLEASE+ENTER+SUMMARY

@DeeDeeG
Copy link

DeeDeeG commented Mar 13, 2021

Filed as an Arch bug: https://bugs.archlinux.org/task/69969

I have no comment on the very interesting task number that was assigned.

@eli-schwartz
Copy link

The basis for this issue is that Arch does this:

  mv "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share/

The idea, in principle, is to let people use the system manpage mechanism to find manpages. So man npm-ci works but npm help ci does not -- because npm help does its own lookup in private directories.

Something like the git approach might be a better idea, where every man page is either git-{foo} for a git command, or git{foo} for some concepts like gitrevisions. npm section 5/7 manpages aren't well namespaced right now.

It should be possible to detect "there is no manpage for this" by checking to see if the man program exits with an error. The man-db implementation reserves exit status "16" for "At least one of the pages/files/keywords didn't exist or wasn't matched."

@wraithgar
Copy link
Member

This appears to be an issue w/ Arch.

@eli-schwartz
Copy link

Arguably npm should be better behaved w.r.t. the system manual pages, though. ;) Really, do consider behaving more like git.

@ocket8888
Copy link
Author

It's true that this bug should be closed, since the actual issue is downstream, but an enhancement that would have the side-effect of fixing this bug would be to use the system manual if possible, and I do hope that is considered despite this issue being closed.

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 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

5 participants