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

npmjs version of "bin/elm-optimize-level-2.js" has an invalid shebang #69

Closed
PedroHLC opened this issue Nov 29, 2021 · 6 comments
Closed

Comments

@PedroHLC
Copy link

Hi, we're using elm-optimize-level-2 successfully in at least three projects, so firstly, I would like to thank you!

Today I was bumping them from 0.1.5 to 0.2.3, and our CIs broke with:

$ paack-elm-build
/usr/bin/env: ‘node\r’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

Simply editing node_modules/elm-optimize-level-2/bin/elm-optimize-level-2.js with vim seems to fix it.

But your file on master seems to be just fine and correct. The problem is specific to the one deployed in npmjs.

@ahankinson
Copy link

I also encountered this problem running elm-optimize-level-2 with yarn. Editing the executable and creating new line endings fixed it.

@PedroHLC
Copy link
Author

@mdgriffith any intention to republish it?

@MarcoDaniels
Copy link

The issue seems to be due to the line ending of the file CRLF instead of LF. A quick fix until it gets updated would be to use the package crlf and use it in a post install:

  "scripts": {
    "postinstall": "crlf --set=LF node_modules/elm-optimize-level-2/bin/elm-optimize-level-2.js"
  },

@cmditch
Copy link
Contributor

cmditch commented Feb 6, 2022

Are you publishing from Windows or Mac @mdgriffith?

Looks like if it's republished from Mac, we won't encounter this issue. If you're publishing from Windows we might have to find another solution.

Edit: We could enforce LF line endings w/ .gitattributes. See here.

@mdgriffith
Copy link
Owner

Ah, I probably published from my Windows comp last time because that's where I was benchmarking from.

I'll publish from my mac this time!

@mdgriffith
Copy link
Owner

Ok, new version published! This should be resolved. Ping me here if it isn't!

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

5 participants