Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Linking man pages silently fails #3405

Closed
mathiasbynens opened this Issue May 3, 2013 · 5 comments

Comments

Projects
None yet
6 participants
Contributor

mathiasbynens commented May 3, 2013

npm doesn’t seem to install man pages for packages (using the man entry in package.json). I’ve checked using npm install -g luamin --verbose, and it does log the linkMans step, but luamin.1 doesn’t show up in /usr/local/share/man/man1 at all. Any instructions on how to debug this? Is there a better way to figure out where npm put the man pages, if anywhere?

Here’s an excerpt from the npm install -g luamin --verbose log:

[…]
npm info linkStuff luamin@0.2.5
npm verb linkBins luamin@0.2.5
npm verb link bins [ { luamin: 'bin/luamin' }, '/usr/local/bin', true ]
npm verb linkMans luamin@0.2.5
npm verb rebuildBundles luamin@0.2.5
npm verb rebuildBundles [ '.bin', 'luaparse' ]
[…]

(Here’s a link to luamin’s package.json.)

Also, man npm etc. don’t work.

I’ve updated npm to v1.2.19 to try the latest fix for #109, but I’m still having the same issue.

@mathiasbynens mathiasbynens referenced this issue in mathiasbynens/luamin May 11, 2013

Closed

Add man page for the `luamin` binary #12

Contributor

luk- commented Aug 17, 2013

Some of the way npm handles man pages was changed recently, can you try this again?

Contributor

mathiasbynens commented Aug 18, 2013

Still having this issue using npm 1.3.8 on OS X.

$ npm -v
1.3.8

$ npm install luamin -g --verbose
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli   '/usr/local/share/npm/bin/npm',
npm verb cli   'install',
npm verb cli   'luamin',
npm verb cli   '-g',
npm verb cli   '--verbose' ]
npm info using npm@1.3.8
npm info using node@v0.10.16
npm verb node symlink /usr/local/bin/node
npm verb cache add [ 'luamin', null ]
npm verb cache add name=undefined spec="luamin" args=["luamin",null]
npm verb parsed url { protocol: null,
npm verb parsed url   slashes: null,
npm verb parsed url   auth: null,
npm verb parsed url   host: null,
npm verb parsed url   port: null,
npm verb parsed url   hostname: null,
npm verb parsed url   hash: null,
npm verb parsed url   search: null,
npm verb parsed url   query: null,
npm verb parsed url   pathname: 'luamin',
npm verb parsed url   path: 'luamin',
npm verb parsed url   href: 'luamin' }
npm verb lock luamin /Users/Mathias/.npm/1cdf5f4f-luamin.lock
npm verb addNamed [ 'luamin', '' ]
npm verb addNamed [ null, '*' ]
npm verb lock luamin@ /Users/Mathias/.npm/89a2ef35-luamin.lock
npm verb url raw luamin
npm verb url resolving [ 'https://registry.npmjs.org/', './luamin' ]
npm verb url resolved https://registry.npmjs.org/luamin
npm info trying registry request attempt 1 at 11:06:05
npm verb etag "B0U6CFU01GFEO4PKV4SAUNNJ9"
npm http GET https://registry.npmjs.org/luamin
npm http 304 https://registry.npmjs.org/luamin
npm verb etag luamin from cache
npm verb addNamed [ 'luamin', '0.2.8' ]
npm verb addNamed [ '0.2.8', '0.2.8' ]
npm verb lock luamin@0.2.8 /Users/Mathias/.npm/cd15748d-luamin-0-2-8.lock
npm info install luamin@0.2.8 into /usr/local/lib
npm info installOne luamin@0.2.8
npm info /usr/local/lib/node_modules/luamin unbuild
npm info preuninstall luamin@0.2.8
npm info uninstall luamin@0.2.8
npm verb true,/usr/local/lib/node_modules,/usr/local/lib/node_modules unbuild luamin@0.2.8
npm verb /usr/local/bin,[object Object] binRoot
npm info postuninstall luamin@0.2.8
npm verb tar unpack /Users/Mathias/.npm/luamin/0.2.8/package.tgz
npm verb lock tar:///usr/local/lib/node_modules/luamin /Users/Mathias/.npm/cf3097f7-sr-local-lib-node-modules-luamin.lock
npm verb lock tar:///Users/Mathias/.npm/luamin/0.2.8/package.tgz /Users/Mathias/.npm/4d0a0833-ias-npm-luamin-0-2-8-package-tgz.lock
npm info preinstall luamin@0.2.8
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb cache add [ 'luaparse@~0.1.4', null ]
npm verb cache add name=undefined spec="luaparse@~0.1.4" args=["luaparse@~0.1.4",null]
npm verb parsed url { protocol: null,
npm verb parsed url   slashes: null,
npm verb parsed url   auth: null,
npm verb parsed url   host: null,
npm verb parsed url   port: null,
npm verb parsed url   hostname: null,
npm verb parsed url   hash: null,
npm verb parsed url   search: null,
npm verb parsed url   query: null,
npm verb parsed url   pathname: 'luaparse@~0.1.4',
npm verb parsed url   path: 'luaparse@~0.1.4',
npm verb parsed url   href: 'luaparse@~0.1.4' }
npm verb cache add name="luaparse" spec="~0.1.4" args=["luaparse","~0.1.4"]
npm verb parsed url { protocol: null,
npm verb parsed url   slashes: null,
npm verb parsed url   auth: null,
npm verb parsed url   host: null,
npm verb parsed url   port: null,
npm verb parsed url   hostname: null,
npm verb parsed url   hash: null,
npm verb parsed url   search: null,
npm verb parsed url   query: null,
npm verb parsed url   pathname: '~0.1.4',
npm verb parsed url   path: '~0.1.4',
npm verb parsed url   href: '~0.1.4' }
npm verb addNamed [ 'luaparse', '~0.1.4' ]
npm verb addNamed [ null, '>=0.1.4-0 <0.2.0-0' ]
npm verb lock luaparse@~0.1.4 /Users/Mathias/.npm/2787e7e4-luaparse-0-1-4.lock
npm verb url raw luaparse
npm verb url resolving [ 'https://registry.npmjs.org/', './luaparse' ]
npm verb url resolved https://registry.npmjs.org/luaparse
npm info trying registry request attempt 1 at 11:06:08
npm verb etag "I58PI8RBO7J8MQQ7CKH2CCUI"
npm http GET https://registry.npmjs.org/luaparse
npm http 304 https://registry.npmjs.org/luaparse
npm verb etag luaparse from cache
npm verb addNamed [ 'luaparse', '0.1.4' ]
npm verb addNamed [ '0.1.4', '0.1.4' ]
npm verb lock luaparse@0.1.4 /Users/Mathias/.npm/8e28dd8a-luaparse-0-1-4.lock
npm info install luaparse@0.1.4 into /usr/local/lib/node_modules/luamin
npm info installOne luaparse@0.1.4
npm info /usr/local/lib/node_modules/luamin/node_modules/luaparse unbuild
npm verb tar unpack /Users/Mathias/.npm/luaparse/0.1.4/package.tgz
npm verb lock tar:///usr/local/lib/node_modules/luamin/node_modules/luaparse /Users/Mathias/.npm/3dc14a6f-les-luamin-node-modules-luaparse.lock
npm verb lock tar:///Users/Mathias/.npm/luaparse/0.1.4/package.tgz /Users/Mathias/.npm/3a464de9-s-npm-luaparse-0-1-4-package-tgz.lock
npm info preinstall luaparse@0.1.4
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb about to build /usr/local/lib/node_modules/luamin/node_modules/luaparse
npm info build /usr/local/lib/node_modules/luamin/node_modules/luaparse
npm verb linkStuff [ true,
npm verb linkStuff   '/usr/local/lib/node_modules',
npm verb linkStuff   false,
npm verb linkStuff   '/usr/local/lib/node_modules/luamin/node_modules' ]
npm info linkStuff luaparse@0.1.4
npm verb linkBins luaparse@0.1.4
npm verb link bins [ { luaparse: 'bin/luaparse' },
npm verb link bins   '/usr/local/lib/node_modules/luamin/node_modules/.bin',
npm verb link bins   false ]
npm verb linkMans luaparse@0.1.4
npm verb rebuildBundles luaparse@0.1.4
npm info install luaparse@0.1.4
npm info postinstall luaparse@0.1.4
npm verb about to build /usr/local/lib/node_modules/luamin
npm info build /usr/local/lib/node_modules/luamin
npm verb linkStuff [ true,
npm verb linkStuff   '/usr/local/lib/node_modules',
npm verb linkStuff   true,
npm verb linkStuff   '/usr/local/lib/node_modules' ]
npm info linkStuff luamin@0.2.8
npm verb linkBins luamin@0.2.8
npm verb link bins [ { luamin: 'bin/luamin' }, '/usr/local/bin', true ]
npm verb linkMans luamin@0.2.8
npm verb rebuildBundles luamin@0.2.8
npm verb rebuildBundles [ '.bin', 'luaparse' ]
/usr/local/bin/luamin -> /usr/local/lib/node_modules/luamin/bin/luamin
npm info install luamin@0.2.8
npm info postinstall luamin@0.2.8
luamin@0.2.8 /usr/local/lib/node_modules/luamin
└── luaparse@0.1.4
npm verb exit [ 0, true ]
npm info ok

$ man luamin
No manual entry for luamin

Bump

I seem to be having the same issue with a package that I'm building. I'm using npm -v 1.4.7 on OS X. Everything installs fine except for the man page. Running install with --verbose gives me this npm verb linkMans knockout-tools@0.1.6 in the output.

And checking for the man page results:

❯ man kotools
No manual entry for kotools

I even checked luamin to make sure I wasn't crazy:

/usr/local/lib/node_modules master*
❯ npm i -g luamin
npm http GET http://registry.npmjs.org/luamin
npm http 200 http://registry.npmjs.org/luamin
npm http GET http://registry.npmjs.org/luamin/-/luamin-0.2.8.tgz
npm http 200 http://registry.npmjs.org/luamin/-/luamin-0.2.8.tgz
npm http GET http://registry.npmjs.org/luaparse
npm http 200 http://registry.npmjs.org/luaparse
npm http GET http://registry.npmjs.org/luaparse/-/luaparse-0.1.6.tgz
npm http 200 http://registry.npmjs.org/luaparse/-/luaparse-0.1.6.tgz
/usr/local/bin/luamin -> /usr/local/lib/node_modules/luamin/bin/luamin
luamin@0.2.8 /usr/local/lib/node_modules/luamin
└── luaparse@0.1.6

/usr/local/lib/node_modules master*
❯ man luamin
No manual entry for luamin

I've tried to following in my package.json:

"man": "man/kotools.1"
"man": "./man/kotools.1"
"man": ["man/kotools.1"]
"man": ["./man/kotools.1"]

I was able to figure out how to get this working finally.

The secret sauce was found with a little trial and error after reading this article Unix and Node: Manual Pages - Installing Manual Pages. It wasn't very clear at first, but the key was to point to the folder where the roff file lives and not the path to the roff file:

"directories": {
  "man": "<folder_to_manpage>"
}
So the following are incorrect:
"bin": "bin/luamin",
"man": "man/luamin.1",
...
"bin": "bin/luamin",
"man": "man/luamin.1",
"directories": {
  "man": "man/luamin.1"
},
...
"bin": "bin/luamin",
"directories": {
  "man": "man/luamin.1"
},
...
The correct way:
  • No man key at the root level
  • A directories entry with a man key that has a value which points to the folder where the roff file lives
"bin": "bin/luamin",
"directories": {
  "man": "man"
}

@othiym23 othiym23 added the bug label Oct 10, 2014

busches commented Sep 26, 2016

@KenanY this appears to have been fixed by @bengl's PR #7299

@KenanY KenanY closed this Sep 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment