hyper icon indicating copy to clipboard operation
hyper copied to clipboard

As a Windows Hyper user, I should be able to install packages regardless of which shell I am using

Open belthesar opened this issue 9 years ago • 5 comments

  • [x] I am on the latest Hyper.app version
  • [x] I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: Windows 10 build 15014
  • Hyper.app version: 1.1.0
  • Link of a Gist with the contents of your .hyper.js: https://gist.github.com/belthesar/b8a8f608a5ed47becd96068706eb6648
  • Relevant information from devtools (CMD+ALT+I on Mac OS, CTRL+SHIFT+I elsewhere): N/A
  • The issue is reproducible in vanilla Hyper.app: Yes

Issue

Problem: When running a shell other than 'cmd' on Windows, packages do not install successfully.
Steps to Reproduce:

  1. With a functional Hyper install (vanilla, or with packages installed), modify your .hyper.js config to change the shell to a different shell (EG: "C:\Windows\System32\bash.exe" or "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe").
  2. Add or remove packages.

Expected Result:

Packages are installed or uninstalled as requested by adjusting the config.

Actual Result:

Packages are not installed. Error suggest to look at %userprofile%.hyper_plugins\npm-debug.log This log file is never generated.

Additional info: Running Hyper within a cmd window provides additional logging that suggests that there is some sort of hard coding that is attempting to run whatever the current shell is with switches that only work with 'cmd'.

plugins have changed / not init, scheduling plugins installation
running in prod mode
electron will open file://C:\Users\belthesar\AppData\Local\hyper\app-1.1.0\resources\app\index.html
Checking for notification messages
No matching notification messages
Error: Command failed: npm prune && npm install --production
/bin/bash: /s: No such file or directory

    at ChildProcess.exithandler (child_process.js:218:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)
[Notification] Error updating plugins.: Check `~/.hyper_plugins/npm-debug.log` for more information.

belthesar avatar Feb 03 '17 03:02 belthesar

Me too. I'm using PowerShell. I can't install any package.

gluons avatar Feb 09 '17 02:02 gluons

I remember reading a temp fix in a different PR.

Comment this line in plugins.js. Restart hyper and try to install any hyper package

srimajji avatar Feb 10 '17 08:02 srimajji

@srimajji That does fix the issue.

The problem is Node's child_process.exec requires the shell passed in the shell parameter to support the -c switch on UNIX and /s /c on Windows.

It may be better to not pass the shell option during the plugin work.

jordansjones avatar Feb 14 '17 19:02 jordansjones

It may be better to not pass the shell option during the plugin work.

@jordansjones Agreed with this recommendation. Unless there's a need to preserve environment, which I can't see, lowest common denominator shell execution seems like the preferred behavior across all platforms.

belthesar avatar Feb 14 '17 21:02 belthesar

Hey there, please try again with the new Hyper v2 release and open a new issue if the problem stills exists. Thank you!

Stanzilla avatar Apr 23 '18 01:04 Stanzilla