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

Semistandard broken on OS X starting in 14.2.1 #266

Closed
apodolny opened this issue Jul 5, 2020 · 4 comments
Closed

Semistandard broken on OS X starting in 14.2.1 #266

apodolny opened this issue Jul 5, 2020 · 4 comments

Comments

@apodolny
Copy link

apodolny commented Jul 5, 2020

What version of this package are you using?
14.2.2, but I've test 14.2.1 and 14.2.0. 14.2.0 is fine, but after that it's broken

What operating system, Node.js, and npm version?
MacOS 10.15.5
Node 12.16.2
(also fails on MacOS 10.13 and Node.js 10) as detailed in Travis CI build here: https://travis-ci.org/github/lovell/sharp/jobs/705021697

What happened?
Running semistandard fails immediately with the error:
env: node\r: No such file or directory error Command failed with exit code 127.

What did you expect to happen?
Semistandard to run.

Are you willing to submit a pull request to fix this bug?
Don't have any experience with the codebase at the moment.

apodolny added a commit to colonylabs/sharp that referenced this issue Jul 5, 2020
@clsource
Copy link

This is due to the file cmd.js https://github.com/standard/semistandard/blob/master/bin/cmd.js

It has a windows end of line CRLF. To fix this just need to overwrite the file line endings.

Its probably a yarn issue
yarnpkg/yarn#5480

because node automatically converts newlines

npm/npm#12371

https://stackoverflow.com/questions/30344858/node-script-executable-not-working-on-mac-env-node-r-no-such-file-or-directo

@hutson
Copy link

hutson commented Jul 25, 2020

I also encountered this recently when the CI tests for an automated lockfile update failed - hyper-expanse/semantic-delivery-gitlab#42

The issue, as noted by @apodolny, began occurring with version 14.2.1:

info Direct dependencies
└─ semistandard@14.2.1
info All dependencies
├─ ansi-escapes@4.3.1
├─ cli-cursor@3.1.0
├─ cli-width@3.0.0
├─ eslint-config-standard@14.1.1
├─ eslint@6.8.0
├─ espree@6.2.1
├─ figures@3.2.0
├─ globals@12.4.0
├─ inquirer@7.3.3
├─ mimic-fn@2.1.0
├─ mute-stream@0.0.8
├─ onetime@5.1.0
├─ optionator@0.8.3
├─ restore-cursor@3.1.0
├─ run-async@2.4.1
├─ rxjs@6.6.0
└─ semistandard@14.2.1
Done in 4.83s.
$ cat -v node_modules/.bin/semistandard
#!/usr/bin/env node^M
^M
var opts = require('../options.js')^M
require('standard-engine').cli(opts)^M

The previous version, 14.2.0 does not contain the Windows line endings:

info Direct dependencies
└─ semistandard@14.2.0
info All dependencies
├─ ansi-escapes@3.2.0
├─ cli-cursor@2.1.0
├─ cli-width@2.2.1
├─ eslint-config-standard@14.1.0
├─ eslint@6.4.0
├─ espree@6.2.1
├─ figures@2.0.0
├─ inquirer@6.5.2
├─ mimic-fn@1.2.0
├─ mute-stream@0.0.7
├─ onetime@2.0.1
├─ optionator@0.8.3
├─ restore-cursor@2.0.0
├─ run-async@2.4.1
├─ rxjs@6.6.0
└─ semistandard@14.2.0
Done in 3.87s.
$ cat -v node_modules/.bin/semistandard
#!/usr/bin/env node

var opts = require('../options.js')
require('standard-engine').cli(opts)

@Flet would you be willing to publish a version 14.2.3 using npm?

@Flet
Copy link
Member

Flet commented Jul 25, 2020

ok will do

@Flet
Copy link
Member

Flet commented Jul 25, 2020

published semistandard@14.2.3 sorry for the trouble!

@Flet Flet closed this as completed Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants