torrentflix icon indicating copy to clipboard operation
torrentflix copied to clipboard

`/usr/bin/env: ‘node\r’: No such file or directory` on Linux

Open smhmd opened this issue 4 years ago • 6 comments

image

This probably has to do with line endings between Windows and Linux (I'm using Linux). I had to delete the file and rewrite it to work. (alternatively, you could run some utility against it.)

smhmd avatar Apr 19 '20 21:04 smhmd

Hm interesting what file did you have to delete ?

ItzBlitz98 avatar Apr 19 '20 21:04 ItzBlitz98

This one: https://github.com/ItzBlitz98/torrentflix/blob/1600140721b520b34a59ca5d72c8e79eb36869f0/bin/torrentflix#L1-L2

On my system:

$ which torrentflix
/home/me/.npm-packages/bin/torrentflix
$ readlink -f /home/me/.npm-packages/bin/torrentflix
/home/me/.config/yarn/global/node_modules/torrentflix/bin/torrentflix

So, /home/me/.config/yarn/global/node_modules/torrentflix/bin/torrentflix. (I'm using yarn.)

smhmd avatar Apr 19 '20 22:04 smhmd

After some research its because you are using yarn and i'm publishing from windows, This is apparently what happens in that scenario. I will try to publish future releases using Linux that should fix this issue.

ItzBlitz98 avatar Apr 19 '20 23:04 ItzBlitz98

Is there an issue in https://github.com/yarnpkg/yarn about this to upvote?

smhmd avatar Apr 19 '20 23:04 smhmd

I dont think its a yarn issue its https://github.com/npm/npm/issues/2097 Not sure why only yarn is effected though

ItzBlitz98 avatar Apr 19 '20 23:04 ItzBlitz98

Still have to do this every now and then:

echo $'#!/usr/bin/env node\nrequire(\'../lib/cli.js\');' > /home/me/.config/yarn/global/node_modules/torrentflix/bin/torrentflix

smhmd avatar Jun 25 '20 02:06 smhmd