nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
77.71k stars 7.81k forks source link

npm man pages not accessible #495

Open kojiwakayama opened 9 years ago

kojiwakayama commented 9 years ago

Problem: npm man pages are not working for me when I run: $ man npm

Reason: npm man pages path (~NODE_PATH/npm/man) is not in $MANPATH

Solution: npm man pages path (~NODE_PATH/npm/man) needs to be added to $MANPATH at: https://github.com/creationix/nvm/blob/master/nvm.sh#L586

ljharb commented 9 years ago

man npm doesn't work for me on a standard node install either. I have to do MANPATH=/usr/local/lib/node_modules/npm/man man npm in order to get it to work.

This sounds like a node issue, not an nvm one?

kojiwakayama commented 9 years ago

there are npm man pages at: $NVM_DIR/$VERSION/lib/node_modules/npm/man . Would be great if it could be added like the node man pages: https://github.com/creationix/nvm/blob/master/nvm.sh#L586

ljharb commented 9 years ago

Right, but what I'm saying is, node itself doesn't add those manpages when installed from source without nvm.

nvm shouldn't be setting up node any differently than the normal installation does.

kojiwakayama commented 9 years ago

it works for me on my machine where I have node installed via homebrew

ljharb commented 9 years ago

Homebrew's not an officially supported way to install node - I wouldn't recommend it. The only supported (and recommended) ways are the downloadable binaries, or from source - which nvm uses.

It's possible that the homebrew formula does some extra magic to make that manpage work.

kojiwakayama commented 9 years ago

The npm man pages work as well on a machine with Node installed via the official DMG image. It doesn't work for me when installing from source neither. Maybe its good to report an issue with Node.

kojiwakayama commented 9 years ago

https://github.com/joyent/node/issues/8129

ljharb commented 9 years ago

Thanks! That definitely narrows it down.

xuhdev commented 3 months ago

Still not fixed today. I installed on Debian via the install script.