Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package seems to be published with CRLF, which breaks CLI installed with yarn. #1154

Closed
simonbuchan opened this issue Dec 22, 2020 · 1 comment

Comments

@simonbuchan
Copy link

As with title, yarn global add mssql && mssql will fail with something like Command not found: node\r on linux/mac.

This is a known issue/difference with yarn from NPM, which will fix up the installed file line endings, but it's easy enough to fix for the package author - depending on your publishing setup, this may be as simple as adding a .gitattributes with * text=auto eol=lf or specifically bin/mssql text eol=lf if the former causes issues.

Expected behaviour:

The package bin file, at least, should be published with Unix line endings.

Actual behaviour:

When installed with yarn, the bin file uses Windows line endings, which confuses /usr/bin/env, as it looks for a binary called node\r, due to the hashbang line being #!/usr/bin/env node\r\n and it interpreting only the \n as the line ending.

When installed with NPM, it will fixup the line endings to be unix so this works.

Configuration:

Software versions

  • NodeJS: v14.4.0
  • node-mssql: v6.3.0
  • SQL Server:
@dhensby
Copy link
Collaborator

dhensby commented Jan 1, 2021

@simonbuchan thanks for reporting this; I've tried to fix this but when I was checking out locally on my windows machine I wasn't noticing the bin file had CRLF line endings. I've gone and published 6.3.1 which hopefully will solve the problem. Let me know if you have any more problems.

@dhensby dhensby closed this as completed Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants