Coder Social home page Coder Social logo

Comments (19)

max-mapper avatar max-mapper commented on August 11, 2024

Hmm I have no idea (and dont have a windows 8 environment to test in). Maybe a good starting point would be to find the source code that generates that .cmd file?

from electron-prebuilt.

bcomnes avatar bcomnes commented on August 11, 2024

@juliankrispel What happens if you run it inside the shell provided by Git BASH from https://msysgit.github.io/ ?

from electron-prebuilt.

jdwilliams15 avatar jdwilliams15 commented on August 11, 2024

I can confirm that this does not work on either my windows 7 system or my a windows 8 system. Used git bash, did 'npm install -g atom-shell'. The error message I get when I try to run is ' line 1: /node_modules/atom-shell/run.bat: No such file or directory'

from electron-prebuilt.

flying-circus avatar flying-circus commented on August 11, 2024

C'mon guys current released electron.cmd doesn't work even if I run it under Github Shell environment!!!
If I change .cmd contents to:
"%~dp0\node_modules\electron-prebuilt\run.bat" %*

works as it should!

from electron-prebuilt.

max-mapper avatar max-mapper commented on August 11, 2024

If any windows devs want to send a pull request that fixes this we would be happy to merge it. None of the current maintainers have time or expertise to debug windows support beyond CMD.EXE, which it currently works with.

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

Having a look at this, no solution yet. However we need this electron windows fix to be released too before everything will work.

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

@flying-circus npm uses cmd-shim to create the cmd file.

I am looking into how the shebang handling is done for windows.

from electron-prebuilt.

jrsconfitto avatar jrsconfitto commented on August 11, 2024

i'm seeing the same issue and i'm happy to help resolve it, but i'm not quite understanding what's happening and would like to before i propose any changes.

Dumb question here: how does the electron.bat file get into the .bin folder? Is that the cmd-shim's responsibility? Let me explain myself if that's not very clear... i'm seeing two different batch files at play.

One batch file, ~\AppData\npm\Roaming\electron.cmd, doesn't work for me, and contains:

@IF EXIST "%~dp0\/bin/bash.exe" (
  "%~dp0\/bin/bash.exe"  "%~dp0\node_modules\electron-prebuilt\run.bat" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  /bin/bash  "%~dp0\node_modules\electron-prebuilt\run.bat" %*
)

The ~\AppData\npm\Roaming\node_modules\electron-prebuilt\run.bat file contains:

"C:\Users\james_000\AppData\Roaming\npm\node_modules\electron-prebuilt\dist\electron.exe" %*

The first batch file doesn't work for me, the second works fine. Is it possible to get that second batch file into the first's location? Is that just something that needs to be added to the install.js script or is there some deeper fix neede?

⚠️ i've only ever consumed npm packages, never generated one myself, so sorry if there's obvious knowledge i'm missing here. ⚠️

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

@jugglingnutcase Thanks! I'm very close to sending the pull request. The issue is that the shebang is determined before install.js runs. And the run.bat file prior to install running has a bash shebang hence the /bin/bash in the cmd file. cmd-shim doesn't create an if statement with a blank shebang.

I have fixed this with a simple preinstall step.

It's working in a cmd environment but not when using git bash in windows.

from electron-prebuilt.

jrsconfitto avatar jrsconfitto commented on August 11, 2024

i had the same fix in progress 😄 i'll wait for your fix to hit then.

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

@jugglingnutcase :)

from electron-prebuilt.

jrsconfitto avatar jrsconfitto commented on August 11, 2024

Did you submit it here?

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

I will associate the pull request fixing this. Not submitted yet due to the git bash issue.

from electron-prebuilt.

jrsconfitto avatar jrsconfitto commented on August 11, 2024

@JamesKyburz i just tested your fix and it works fine for me in GitHub for Windows git bash:

james_000@NEO ~/Documents/src/test-electron-prebuilt/node_modules/.bin
$ cmd "/c electron.cmd"

c:\Users\james_000\Documents\src\test-electron-prebuilt\node_modules\.bin>"c:\Users\james_000\Documents\src\test-electron-prebuilt\node_modules\.bin\\..\electron-prebuilt\run.bat"

c:\Users\james_000\Documents\src\test-electron-prebuilt\node_modules\.bin>"c:\Users\james_000\Documents\src\test-electron-prebuilt\node_modules\electron-prebuilt\dist\electron.exe"
[12384:0421/132342:INFO:renderer_main.cc(212)] Renderer process started

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

@jugglingnutcase Nice! FYI I'm force pushing like a made man at the mo ;)

Basically git bash needs the shebang and cmd doesn't. Still playing around to be sure.

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

@jugglingnutcase I sent the pull request now.

Not happy with having to check the process.title for git bash but should work. cygwin will never work anyways ;)

I have verified that it works in cmd.exe but as I am suffering from this issue preventing me to checking the git bash env.

Could you please check it works in your git bash environment?

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

@jugglingnutcase never mind the process.title is npm when npm is installing.......Will look at this again tomorrow.

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

OK done now. All the sane things failed in windows like echo $SHELL or checking for the presence of /bin/bash.

I came up with process.env.TERM this is falsy in cmd.exe and set to something otherwise.

I have verified both cmd.exe and git bash on my virtual machine running win 8.1.

from electron-prebuilt.

JamesKyburz avatar JamesKyburz commented on August 11, 2024

Please see pull request for details. I replaced run.bat with cli.js and removed the preinstall step.

from electron-prebuilt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.