You are not logged in.
Running
npm help <command>usually displays npm's man page on <command>. And if the the command doesn't exist, npm will show a "top hits" list of related commands.
But since upgrading to 0.8.3, running it will always show the "top hits" list, even for existing commands.
After digging around I found that the problem is the man files that npm uses in /usr/lib/node_modules/npm/man are gzipped (with filenames like install.1.gz) which breaks npm since npm is expecting ungizipped filenames.
After further digging, it seems that the gzipping of npm's man pages was only added in node 0.8.2-2
So, basically just checking if anyone has this same problem (and confirming it's not a problem with upstream) before submitting it to bugs.archlinux.org ![]()
Offline
I've never used npm, but most man pages are gzipped and the "man" program reads them properly.
So a few steps I would take in your situation is first verify that "man <somepage>" works for other gz'ed man pages. I suspect it will, or you would have noticed much wider ranging problems, but still it's worth a quick check. `man bash` would be a suitable check.
Then, I'd find where those command-specific man pages are stored. `pacman -Ql <npm package name> | grep man` should tell you this. See if you can open read these files by passing `man` the full path to one of the gzipped command man-pages.
If those both work, then I'd look into how npm's help command redirects you to the appropriate man page.
I was going to tinker with checking this out myself - but I don't seem to know enough about this tool. Which npm package(s) are you using? I found several in the aur, and the first ones I tried wouldn't build.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'm using npm that comes bundled with node:
$ pacman -Ss nodejs
community/nodejs 0.8.3-3 [installed]
Evented I/O for V8 javascriptOK, so:
man bash # worksnpm's man pages are stored in /usr/lib/node_modules/npm/man/man1/*.1.gz, so:
man /usr/lib/node_modules/npm/man/man1/install.1.gz # worksI've been digging around npm's source, specifically help-related modules and this is where 'npm help' handle man paths (help.js):
var sectionPath = path.join( __dirname, "..", "man", "man" + num, section + "." + num)As you can see '.gz' is not appended to the filename. Looking at it's commit history, this line has been around awhile.
So, I'm not sure if I should submit this issue directly to npm, or bugs.archlinux?
I'm a bit of a newb in this regard, is gzipping man pages a standard thing *linux package managers do that is independent of the packaged app's make/install process? Even if said man pages are not installed system-wide but merely used as a documentation format (which is what npm is doing, if I'm not mistaken)
Offline
The man command should handle gzipped or non-zipped man pages just fine. I'm not sure if there is an official standard, but packages are free to use gz'ed or non-zipped man pages - they both work just fine. If it's not an official standard recommendation, though, gzipped man pages have become so common that they are almost a 'de facto' standard. But package managers (at least pacman) do not gzip the man pages. This is generally handled upstream or in the packages Makefile.
But, more to the point for the present issue, while man can open either format of page, if you give a full path, you must include the extension. Example:
$pacman -Ql bash | grep man
bash /usr/share/man/
bash /usr/share/man/man1/
bash /usr/share/man/man1/bash.1.gz
bash /usr/share/man/man1/bashbug.1.gz
$ man bash #works
$ man /usr/share/man/man1/bash.1.gz #works
$ man /usr/share/man/man1/bash.1
man: /usr/share/man/man1/bash.1: No such file or directory
No manual entry for /usr/share/man/man1/bash.1---------------------------------------
.... er ... I just installed this again and did some tinkering. Most of what I've said is true (and perhaps someday useful) but currently irrelevant. Npm does not use `man` at all. It just echo's it's help information directly to the terminal.
Perhaps the syntax has changed since the last version you used, but it seems to be doing just what it is supposed to:
$ npm help
Usage: npm <command>
where <command> is one of:
... <snip> ...
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm faq commonly asked questions
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/home/jmcclure/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@1.1.43 /usr/lib/node_modules/npm
$ npm help cache
Top hits for "cache"
————————————————————————————————————————————————————————————————————————————————
npm help cache cache:23
npm help config cache:20
npm help folders cache:7
npm help pack cache:2
npm help index cache:2
npm help changelog cache:1
————————————————————————————————————————————————————————————————————————————————
(run with -l or --long to see more context)
$ npm cache -h
npm cache add <tarball file>
npm cache add <folder>
npm cache add <tarball url>
npm cache add <git url>
npm cache add <name>@<version>
npm cache ls [<path>]
npm cache clean [<pkg>[@<version>]]Note in the first output it specifies that "npm help <term>" is only supposed to search for the term and return the top-listing list while "npm <command> -h" is the syntax to view the help information for a given command.
Last edited by Trilby (2012-07-25 14:16:31)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
OK. Well, I guess what I'm describing is the behavior of the npm help npm command, e.g. "invloved overview" (should have made this clear earlier, sorry). This usually would bring up the man page for "npm". Try it, it now only displays a "Top hits" list, not an "invloved overview".
It should also work for other commands (npm help cache, npm help install, etc.)
And I'm pretty sure previously actual man pages would come up (not just echoing of help info). See the source code if you're familiar with javascript. So npm definitely uses man.
It's just a minor annoyance. Basically now I have to open npmjs.org/doc to look for more involved help, which is (imho) uglier than man pages ![]()
I've asked this in npm's mailing lists, I'll post updates if I get any from there. Thanks for helping me look into this ![]()
Offline