PEM-- / meteor-helper

Meteor.js under Atom.io
http://pem-musing.blogspot.fr/2014/07/meteorjs-from-within-atomio-full-stack.html
MIT License
50 stars 9 forks source link

Not shutting down Meteor in Windows Preview 0.1.7 (Feb 9, 2015) #25

Closed landmaxcanada closed 9 years ago

landmaxcanada commented 9 years ago

Using Atom.io on Windows 7, it seems that the meteor starts fine but does not stop when "Toggle" is selected.

PEM-- commented 9 years ago

Meteor on Windows? Ho ho, things are getting serious :wink:

Indeed, it can't. I'm using a UNIX / BSD command for killing the process: killall. I was having trouble stopping the Mongo instance on some cases.

I'm keeping the issue opened until Meteor is officially supported on Windows. I will check if I can do something about it. It will all depend on the way Meteor will spawn Mongo in their official release.

Thanks for the report.

tbiggins commented 9 years ago

Can I (sadly) ask what I should have as the Meteor Path ("customize Meteor's launching command") value for Windows?
I'm running a project in c:\temp\Meteor\leaderboard My environment path is: C:\Users\tbiggins\AppData\Local.meteor I've tried putting: C:\Users\tbiggins\AppData\Local.meteor\meteor.bat (which didn't work) and then tried a separate batch file c:\temp\Meteor\leaderboard\launch.cmd with the following two lines: cd c:\temp\Meteor\leaderboard C:\Users\tbiggins\AppData\Local.meteor\meteor.bat Either way, the error is "Couldn't run tasklist.exe: Tasklist wasn't found on your system..." error

PEM-- commented 9 years ago

JS considers the \ as an escaping character. For win32 using a double \\ stance should allow you to setup paths properly:

c:\\Users\\<my account>\\AppData\\Local.meteor\\meteor
PEM-- commented 9 years ago

Hum... Seems like putting Meteor into a Windows batch file removes the capability of Node to access some required system command.

tbiggins commented 9 years ago

Cool - I figured out a work-around but it's a bit silly:

C:\Users\userFolder\AppData\Local.meteor\meteor.bat

uses SETLOCAL to set meteor variables But when you run this in a Windows command shell, it's pulling the normal SET variables including PATH (which is required to point to the system32 folder for tasklist.exe)

So...

  1. duplicate the meteor.bat file - call the new copy "atommeteor.bat"
  2. open a command prompt, type "SET", then hit ENTER. Copy the PATH variable and paste it into the new atommetor.bat file, just under the SETLOCAL line. But instead of "PATH=", put "SET PATH=" And remember to fix the line wrapping, because Windows likes to line return a lot.
  3. create a launcher in the folder for your project - call it launcher.cmd. This file has one line:

C:\Users\userFolder\AppData\Local.meteor\atommeteor.bat

I know - it's silly - but ... that's the best I could do. ha ha Removing any of these steps seems to break dependencies.

Thanks again!!

PEM-- commented 9 years ago

Happy that it works for you and thanks for your feedback. By any chance, could you check if your move fixes @landmaxcanada's issue?

tbiggins commented 9 years ago

Ha ha - I'm so new to Meteor AND Atom ... I didn't realize my issue was exactly what he was reporting; I didn't know what Toggle was, I just wanted to start Meteor. ha ha

Packages>Meteor>Toggle is in fact Alt + CTRL+ M, which is what I was using to make it work. So yes this solves his problem. But I'm open to any improvements over my hack. ;-)

PEM-- commented 9 years ago

First time user. Wow. Super nice move. Your trick is making the Mongo execution into the same process as the Node's one. Thus making the UNIX/BSD killall unecessary on Windows. :clap:

tbiggins commented 9 years ago

Even a broken clock is correct twice a day. I get lucky sometimes. Thanks so much for your work!