ricardofbarros / linter-js-standard

Atom linter plugin for JavaScript, using JavaScript Standard Style
https://atom.io/packages/linter-js-standard
MIT License
99 stars 48 forks source link

Cannot use newer standard versions on windows #133

Closed ishamf closed 8 years ago

ishamf commented 8 years ago

When a recent version of standard is installed in the project, the plugin wouldn't use it.

I tried to step through the code, and here's what I found:

  1. requireWithLocalOverride tries to load the project's standard
  2. The project's standard loads standard-engine
  3. standard-engine loads get-stdin
  4. get-stdin tries to access process.stdin (even when it's only required and not used).
  5. Accessing process.stdin inside Atom throws an exception on windows stdin
  6. The exception is caught, requireWithLocalOverride loads the default version of standard instead

The older version of standard works because it requires an old version of get-stdin, which doesn't always access process.stdin.

pwagner commented 8 years ago

I get a similar error on Windows 8.1, when the linter-js-standard package (3.4.1) is enabled.

ghost commented 8 years ago

same here:

> spawn-sync@1.0.15 postinstall C:\Users\engs1397\AppData\Local\Temp\apm-install-dir-116723-5880-1atxi7x\node_modules\linter-js-standard\node_modules\standard\node_modules\standard-format\node_modules\esformatter\node_modules\npm-run\node_modules\spawn-sync
> node postinstall

Installing native dependencies (this may take up to a minute)

> spawn-sync@1.0.15 postinstall C:\Users\engs1397\AppData\Local\Temp\apm-install-dir-116723-5880-1atxi7x\node_modules\linter-js-standard\node_modules\semistandard\node_modules\semistandard-format\node_modules\standard-format\node_modules\esformatter\node_modules\npm-run\node_modules\spawn-sync
> node postinstall

> spawn-sync@1.0.15 postinstall C:\Users\engs1397\AppData\Local\Temp\apm-install-dir-116723-5880-1atxi7x\node_modules\linter-js-standard\node_modules\happiness\node_modules\happiness-format\node_modules\esformatter\node_modules\npm-run\node_modules\spawn-sync
> node postinstall

Installing native dependencies (this may take up to a minute)

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN engine deep-extend@0.4.1: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.40","npm":"2.13.3"})
npm WARN engine get-stdin@5.0.1: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.40","npm":"2.13.3"})
npm WARN engine get-stdin@5.0.1: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.40","npm":"2.13.3"})
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Users\\engs1397\\AppData\\Local\\atom\\app-1.9.8\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\engs1397\\AppData\\Local\\atom\\app-1.9.8\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Users\\engs1397\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Users\\engs1397\\.atom\\.apmrc" "install" "C:\\Users\\engs1397\\AppData\\Local\\Temp\\d-116723-5880-1y2vwv2\\package.tgz" "--target=0.37.8" "--arch=ia32"
npm ERR! node v0.10.40
npm ERR! npm  v2.13.3
npm ERR! file C:\WINDOWS\system32\cmd.exe
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! spawn-sync@1.0.15 postinstall: `node postinstall`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the spawn-sync@1.0.15 postinstall script 'node postinstall'.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
Arcanemagus commented 8 years ago

This should be filed on get-stdin then, or possibly standard-engine? Another possibility is that this is something odd about how Atom's embedded Node.js works, but I'm less inclined to think that's the case.

@dariosalviwork Yours looks to be a different issue, caused by the severely out of date version of node embedded within APM. This should be fixed in Atom v1.10.0, you can either switch to the beta channel or just wait till that lands on stable.

Actually those are just warnings, the failure is it tries to call spawn, which doesn't exist on Windows 😕.

ishamf commented 8 years ago

Actually, I'm not really sure where to fix this. I've created a pull request in get-stdin that should fix this, but it might be better to fix it on Electron instead, making process.stdin return some kind of noop stream.

ishamf commented 8 years ago

This is fixed in recent versions of electron.

marvinroger commented 8 years ago

In other words: install Atom >= 1.12.0-beta1