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

Command line error using 6.2.0 #1331

Closed
davidyell opened this issue Apr 9, 2021 · 4 comments
Closed

Command line error using 6.2.0 #1331

davidyell opened this issue Apr 9, 2021 · 4 comments

Comments

@davidyell
Copy link

Environment

  • Mac OS
  • Node 15.10.0
  • "@node-minify/cli": "^6.2.0",

What I did

  • yarn install -D @node-minify/cli
  • yarn run node-minify

What happened

$ yarn run node-minify
yarn run v1.22.4
$ /Users/davidyell/Sites/Envoy/node_modules/.bin/node-minify
env: node\r: No such file or directory
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Things I've tried

  • which node returns /usr/local/bin/node
@davidyell
Copy link
Author

davidyell commented Apr 9, 2021

I think this is just because the executable file has a windows line ending?

#!/usr/bin/env node\r\n

When I edit to to
#!/usr/bin/env node\n

It works okay

@srod
Copy link
Owner

srod commented Jul 1, 2021

Sorry for the delay, do you still have the issue?
I tried on my side; I can't reproduce.
Also tried to use dos2unix to convert cli.js, but nothing changed like it was already in Unix format.

@davidyell
Copy link
Author

@srod Ahok, perhaps I opened the file in an editor which saved it with a different file ending maybe. Thanks for checking! I'll close this one as resolved 👍

@SharzyL
Copy link

SharzyL commented Aug 11, 2021

I also encountered this issue. Though the code on GitHub seems fine:

$ curl -sS https://raw.githubusercontent.com/srod/node-minify/6.2.0/packages/cli/bin/cli.js | head -1 | hexdump -c
0000000   #   !   /   u   s   r   /   b   i   n   /   e   n   v       n
0000010   o   d   e  \n
0000014

when I install from yarn or download from CDN, the fetched code break lines with \r\n. To reproduce:

$ curl -sS https://cdn.jsdelivr.net/npm/@node-minify/cli@6.2.0/bin/cli.js | head -1 | hexdump -c
0000000   #   !   /   u   s   r   /   b   i   n   /   e   n   v       n
0000010   o   d   e  \r  \n
0000015

This problem only occurs for version 6, and only in bin/cli.js. No idea how this happened.

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

3 participants