[Pkg-javascript-devel] Bug#734656: Bug#734656: nodejs: standard node shebang #!/usr/bin/env node fails in Debian as there is no binary/symlink named 'node' in $PATH

Paul Tagliamonte paultag at debian.org
Wed Jan 8 22:33:50 UTC 2014


Tags 734656 - d-i
thanks


On Wed, Jan 08, 2014 at 10:25:05PM +0000, luke wrote:
> Package: nodejs
> Version: 0.10.24~dfsg1-1
> Severity: grave
> Tags: d-i

Why d-i?

> Dear Maintainer,
> 
> Attempting to use many programs installed with `npm install` fails before
> execution because the Node.js interpreter installed by dpkg/synaptic is not at
> the expected path.  The node binary is named 'nodejs' on Debian, but the node
> community expects the de-facto standard of '#!/usr/bin/env node'.

Please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907 for
background on the node / node.js naming issue.

> I understand this is a tricky issue, as Javascript was never really designed to
> be run like a shell script, and does not have the heritage of many other Linux
> shell languages.  Additionally, it is unclear from the Node.js project what the
> official name of the binary should be. That said, here are the accepted
> shebangs for some other interpreters:
> 
> #!/usr/bin/env python
> #!/usr/bin/env/ lua
                ^ that's not right :)

> #!/usr/bin/env perl
> 
> All references to node shebangs I can find on the internet converge on
> #!/usr/bin/env node which is why this issue prevents many npm packages to fail
> to run.
> 
>    * What exactly did you do (or not do) that was effective (or
>      ineffective)?
> 
> Creating a symlink as root: /usr/bin/node -> /usr/bin/nodejs solves the issue
> as far as I can tell.

Sounds like a perfect workaround.

> ln -s -T /usr/bin/nodejs /usr/bin/node && chmod 755 /usr/bin/node
> 
> A quick search of the Sid repositories doesn't show any conflicts with files
> installing to the path /usr/bin/node

Try the package: `node'. It's  not in /usr/bin, but it's on ${PATH}. In
fact, since you're using `env', it's double not clear.

> so doing the simple symlink within the
> Debian installer may be sufficient.

No way. There's a node-legacy package which does this. No need to
involve the installer.

>    * What was the outcome of this action?
> Standard node scripts run correctly as the de-facto node shebang(
> #!/usr/bin/env node) now resolves to 'node' in the user's $PATH
> 
> I'm not very well clued on how this may affect other Debian packages, but works
> in my little world, and this may extend further.
> 
>    * What outcome did you expect instead?
> The expected behaviour is for the Debian package to install nodejs with a
> binary resolvable by the name supported by the node community and existing
> software, rather than with a name that refelects Node.js confusing
> project/binary naming schemes.  Potentially even better would be to support
> 'nodejs' and 'node', but plan to converge on '/usr/bin/node' for the future.
> 

As much as I disagree with ctte on this, I'm afraid that this won't
change. I'd close this, but I'll leave that for the maintainers of node
to do.

Cheers,
  Paul

-- 
 .''`.  Paul Tagliamonte <paultag at debian.org>  |   Proud Debian Developer
: :'  : 4096R / 8F04 9AD8 2C92 066C 7352  D28A 7B58 5B30 807C 2A87
`. `'`  http://people.debian.org/~paultag
 `-     http://people.debian.org/~paultag/conduct-statement.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-javascript-devel/attachments/20140108/e2f1f74b/attachment-0001.sig>


More information about the Pkg-javascript-devel mailing list