Liinkiing / ytomp3

A simple tool to export a YouTube video to a mp3
4 stars 1 forks source link

Windows line endings causes error on unix machines #1

Open vergissberlin opened 3 years ago

vergissberlin commented 3 years ago

Hi,

to build that tool you probably build it on a Windows machine. Could you please check and change if needed the line endings, because it causes a problem on UNIX based operating systems: image

thank you very much! AndrΓ©

vergissberlin commented 3 years ago

I just checked the code base and I couldnΒ΄t find Windows-style line endings CRLF \r\n I have no idea left now, what causes the error πŸ’πŸ»β€β™‚οΈ

Liinkiing commented 3 years ago

I just checked the code base and I couldnΒ΄t find Windows-style line endings CRLF \r\n I have no idea left now, what causes the error πŸ’πŸ»β€β™‚οΈ

hmmm weird, just tried on a MacOS and it looks like it's working fine, on what Node version are you? image

vergissberlin commented 3 years ago

Hi and thank you for your quick response! It is v16.1.0 on macOS.

I tried it now with other versions an I got the same issue:

So it seems not related to the node version. Maybe to the dependencies? This is how it looks like on installation:

yarn global upgrade @liinkiing/ytomp3
yarn global v1.22.10
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
info @ffmpeg-installer/darwin-arm64@4.1.5: The CPU architecture "x64" is incompatible with this module.
info "@ffmpeg-installer/darwin-arm64@4.1.5" is an optional dependency and failed compatibility check. Excluding it from installation.
info @ffmpeg-installer/linux-arm64@4.1.4: The platform "darwin" is incompatible with this module.
info "@ffmpeg-installer/linux-arm64@4.1.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @ffmpeg-installer/linux-arm64@4.1.4: The CPU architecture "x64" is incompatible with this module.
info @ffmpeg-installer/linux-arm@4.1.3: The platform "darwin" is incompatible with this module.
info "@ffmpeg-installer/linux-arm@4.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info @ffmpeg-installer/linux-arm@4.1.3: The CPU architecture "x64" is incompatible with this module.
info @ffmpeg-installer/win32-ia32@4.1.0: The platform "darwin" is incompatible with this module.
info "@ffmpeg-installer/win32-ia32@4.1.0" is an optional dependency and failed compatibility check. Excluding it from installation.
info @ffmpeg-installer/win32-ia32@4.1.0: The CPU architecture "x64" is incompatible with this module.
info @ffmpeg-installer/linux-x64@4.1.0: The platform "darwin" is incompatible with this module.
info "@ffmpeg-installer/linux-x64@4.1.0" is an optional dependency and failed compatibility check. Excluding it from installation.
info @ffmpeg-installer/linux-ia32@4.1.0: The platform "darwin" is incompatible with this module.
info "@ffmpeg-installer/linux-ia32@4.1.0" is an optional dependency and failed compatibility check. Excluding it from installation.
info @ffmpeg-installer/linux-ia32@4.1.0: The CPU architecture "x64" is incompatible with this module.
info @ffmpeg-installer/win32-x64@4.1.0: The platform "darwin" is incompatible with this module.
info "@ffmpeg-installer/win32-x64@4.1.0" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] πŸ”—  Linking dependencies...
warning "fastify-cli > blessed-contrib > marked-terminal@4.1.1" has incorrect peer dependency "marked@^1.0.0 || ^2.0.0".
[4/4] πŸ”¨  Rebuilding all packages...
success Saved lockfile.
success Saved 63 new dependencies.
info Direct dependencies
└─ @liinkiing/ytomp3@1.5.1
info All dependencies
β”œβ”€ @ffmpeg-installer/darwin-x64@4.1.0
β”œβ”€ @ffmpeg-installer/ffmpeg@1.1.0
β”œβ”€ @liinkiing/ytomp3@1.5.1
β”œβ”€ @nodelib/fs.scandir@2.1.5
β”œβ”€ @oclif/parser@3.8.5
β”œβ”€ adm-zip@0.5.9
β”œβ”€ ansi-escape-sequences@5.1.2
β”œβ”€ aproba@1.2.0
β”œβ”€ are-we-there-yet@1.1.7
β”œβ”€ array-back@4.0.2
β”œβ”€ base64-js@1.5.1
β”œβ”€ bl@4.1.0
β”œβ”€ braces@3.0.2
β”œβ”€ code-point-at@1.1.0
β”œβ”€ color-convert@1.9.3
β”œβ”€ color-name@1.1.4
β”œβ”€ color-string@1.6.0
β”œβ”€ console-control-strings@1.1.0
β”œβ”€ delegates@1.0.0
β”œβ”€ eastasianwidth@0.2.0
β”œβ”€ emoji-regex@8.0.0
β”œβ”€ expand-template@2.0.3
β”œβ”€ fill-range@7.0.1
β”œβ”€ gauge@2.7.4
β”œβ”€ github-from-package@0.0.0
β”œβ”€ has-unicode@2.0.1
β”œβ”€ hash-arg@1.0.3
β”œβ”€ homedir@0.6.0
β”œβ”€ ieee754@1.2.1
β”œβ”€ list-it@1.3.7
β”œβ”€ lodash.template@4.5.0
β”œβ”€ lodash.templatesettings@4.2.0
β”œβ”€ lodash.throttle@4.1.1
β”œβ”€ m3u8stream@0.8.4
β”œβ”€ miniget@4.2.1
β”œβ”€ mkdirp-classic@0.5.3
β”œβ”€ napi-build-utils@1.0.2
β”œβ”€ node-abi@2.30.1
β”œβ”€ node-addon-api@3.2.1
β”œβ”€ node-getopt@0.3.2
β”œβ”€ npmlog@4.1.2
β”œβ”€ number-is-nan@1.0.1
β”œβ”€ picomatch@2.3.0
β”œβ”€ prebuild-install@6.1.4
β”œβ”€ process-nextick-args@2.0.1
β”œβ”€ queue-microtask@1.2.3
β”œβ”€ run-parallel@1.2.0
β”œβ”€ sanitize-filename@1.6.3
β”œβ”€ set-blocking@2.0.0
β”œβ”€ sharp@0.27.2
β”œβ”€ simple-get@4.0.0
β”œβ”€ simple-swizzle@0.2.2
β”œβ”€ streamspeed@2.0.1
β”œβ”€ strip-json-comments@2.0.1
β”œβ”€ to-regex-range@5.0.1
β”œβ”€ tr46@0.0.3
β”œβ”€ truncate-utf8-bytes@1.0.2
β”œβ”€ utf8-byte-length@1.0.4
β”œβ”€ webidl-conversions@3.0.1
β”œβ”€ whatwg-url@5.0.0
β”œβ”€ wide-align@1.1.5
β”œβ”€ ytdl@1.4.1
└─ ytpl@2.2.3
✨  Done in 21.77s.

Looks good to me …

So let's check the file in the /usr/local/bin directory which is an symlink /Users/andre.lademann/.config/yarn/global/node_modules/.bin/ytomp3: image

So I can confirm that there is a CRLF encoding there. After changing that, it works. Maybe it depends on the package manager? I had used yarn global add …