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

Windows Support? #28

Closed
LazyFatArrow opened this issue Feb 7, 2017 · 15 comments
Closed

Windows Support? #28

LazyFatArrow opened this issue Feb 7, 2017 · 15 comments

Comments

@LazyFatArrow
Copy link

Hi, I have just installed meteor-now and now globally and when i run meteor-now command in my project i get this error

        this.builddir = pwd.split('/')[pwd.split('/').length - 1];
                           ^

TypeError: Cannot read property 'split' of undefined
at new Dockerfile (C:\Users\Amenallah\AppData\Roaming\npm\node_modules\meteor-now\dist\app.js:838:25)
at Object.<anonymous> (C:\Users\Amenallah\AppData\Roaming\npm\node_modules\meteor-now\dist\app.js:861:40)
at __webpack_require__ (C:\Users\Amenallah\AppData\Roaming\npm\node_modules\meteor-now\dist\app.js:20:30)
at Object.<anonymous> (C:\Users\Amenallah\AppData\Roaming\npm\node_modules\meteor-now\dist\app.js:75:20)
at __webpack_require__ (C:\Users\Amenallah\AppData\Roaming\npm\node_modules\meteor-now\dist\app.js:20:30)
at Object.defineProperty.value (C:\Users\Amenallah\AppData\Roaming\npm\node_modules\meteor-now\dist\app.js:40:18)
at Object.<anonymous> (C:\Users\Amenallah\AppData\Roaming\npm\node_modules\meteor-now\dist\app.js:43:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)

I'm using windows.

@purplecones
Copy link
Collaborator

No windows support yet :-(. We'll be looking into ways of supporting windows but for now this should work on any unix/linux system.

@LazyFatArrow
Copy link
Author

:( ok thnx.

@jkrup
Copy link
Owner

jkrup commented Feb 7, 2017

I'll re-open this ticket since we do want to have windows support. It's just going to be a bit slow since I don't have a windows machine, but I believe we can get past this error by changing https://github.com/mazlix/meteor-now/blob/master/src/dockerfile.js#L20 to const pwd = process.cwd();
However there are probably more issues that will arise on windows.

@jkrup jkrup reopened this Feb 7, 2017
@gcacars
Copy link

gcacars commented Feb 12, 2017

Same for me. Thanks for not supporting Windows!

var version = data.match(/METEOR@(.*)\n/)[1];
                                                     ^
TypeError: Cannot read property '1' of null

@jkrup
Copy link
Owner

jkrup commented Feb 14, 2017

Hey @gcacars, do you know the equivalent of the .meteor/release file for windows? @purplecones and I don't have windows so it's going to be a bit of a slow process of us fixing items as reported by users like you, but basically that code seems to be failing because on windows there is no .meteor/release file. Maybe the folder is _meteor instead of .meteor? If so we'd just want to add a check for OS and swap that.

@LazyFatArrow
Copy link
Author

LazyFatArrow commented Feb 14, 2017

@mazlix there is ./meteor/release file containing meteor version.

@gcacars
Copy link

gcacars commented Feb 16, 2017

@mazlix It's a normal folder:
image

@gcacars
Copy link

gcacars commented Feb 16, 2017

Maybe what is different, is the meteor installation folder:
C:\Users\USER_LOGIN\AppData\Local\.meteor
or just: %UserProfile%\AppData\Local\.meteor

@renanpvaz
Copy link

Same problem here on Windows. It might have something to do with the '\n' here.

When I run this in my meteor project root it always outputs null.

const fs = require('fs');

const data = fs.readFileSync('.meteor/release', {
  encoding: 'utf8',
});

console.log(data.match(/METEOR@(.*)\n/));

But if I remove the '\n' or change it to '\r\n' it works.

@jkrup
Copy link
Owner

jkrup commented Feb 22, 2017

Ah that's right! Windows uses \r\n for line endings! I've started work on a windows support branch for these changes #29

@renanpvaz
Copy link

Nice, glad to help!

@jkrup
Copy link
Owner

jkrup commented Feb 22, 2017

Since I don't have a windows machine and these changes don't break mac I just merged them in and pushed an update.
If you get a chance npm install -g meteor-now@0.1.2 and see if it works now. At the very least you should get a new/different message 🤕

@jkrup jkrup closed this as completed Feb 22, 2017
@jkrup jkrup changed the title cannot read property 'split' of undefined Windows Support? Feb 22, 2017
@jkrup jkrup reopened this Feb 22, 2017
@renanpvaz
Copy link

renanpvaz commented Feb 22, 2017

I updated it and tried running meteor-now passing two env variables. It seemed to get stuck after throwing an error on the "preparing build" step.

V [METEOR-NOW] - building meteor app
?? [METEOR-NOW] - preparing buildPossibly unhandled Error: 1 at Promise$_rejecter (C:\Users\renan.vaz\AppData\Roaming\nvm\v5.12.0\node_mo dules\meteor-now\node_modules\bluebird\js\main\promise.js:590:44) at C:\Users\renan.vaz\AppData\Roaming\nvm\v5.12.0\node_modules\meteor-now\no de_modules\promise-spawner\index.js:85:13 at tryCatch1 (C:\Users\renan.vaz\AppData\Roaming\nvm\v5.12.0\node_modules\me teor-now\node_modules\bluebird\js\main\util.js:63:19) at Promise$_callHandler [as _callHandler] (C:\Users\renan.vaz\AppData\Roamin g\nvm\v5.12.0\node_modules\meteor-now\node_modules\bluebird\js\main\promise.js:6 95:13) at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (C:\User s\renan.vaz\AppData\Roaming\nvm\v5.12.0\node_modules\meteor-now\node_modules\blu ebird\js\main\promise.js:711:18) at Promise$_settlePromiseAt [as _settlePromiseAt] (C:\Users\renan.vaz\AppDat a\Roaming\nvm\v5.12.0\node_modules\meteor-now\node_modules\bluebird\js\main\prom ise.js:868:14) at Promise$_settlePromises [as _settlePromises] (C:\Users\renan.vaz\AppData\ Roaming\nvm\v5.12.0\node_modules\meteor-now\node_modules\bluebird\js\main\promis e.js:1006:14) at Promise$_rejectPromises [as _rejectPromises] (C:\Users\renan.vaz\AppData\ Roaming\nvm\v5.12.0\node_modules\meteor-now\node_modules\bluebird\js\main\promis e.js:999:10) at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (C:\Users\renan. vaz\AppData\Roaming\nvm\v5.12.0\node_modules\meteor-now\node_modules\bluebird\js \main\async.js:74:12) at Async$consumeFunctionBuffer (C:\Users\renan.vaz\AppData\Roaming\nvm\v5.12 .0\node_modules\meteor-now\node_modules\bluebird\js\main\async.js:37:14)
?? [METEOR-NOW] - preparing build

@purplecones
Copy link
Collaborator

@mazlix you can get a windows 10 VirtualBox image here for testing.

I deployed a meteor app under the Windows 10 image and got this:

C:\Users\purplecones\meteor-test>meteor-now -d
[METEOR-NOW] - running command: meteor build .meteor/local/builds --server-only --architecture=os.linux.x86_64

WARNING: The output directory is under your source tree.
         Your generated files may get interpreted as source code!
         Consider building into a different directory instead
         meteor build ../output

[METEOR-NOW] - creating Dockerfile
[METEOR-NOW] - creating supervisor
[METEOR-NOW] - splitting bundle
[METEOR-NOW] - running command: split -b 999999 .meteor/local/builds/C:\Users\purplecones\meteor-test.tar.gz .meteor/local/builds/x && rm .meteor/local/builds/C:\Users\purplecones\meteor-test.tar.gz
'split' is not recognized as an internal or external command,
operable program or batch file.
Possibly unhandled Error: 1
    at Promise$_rejecter (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\promise.js:590:44)
    at C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\promise-spawner\index.js:85:13
    at tryCatch1 (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\util.js:63:19)
    at Promise$_callHandler [as _callHandler] (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\promise.js:695:13)
    at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\promise.js:711:18)
    at Promise$_settlePromiseAt [as _settlePromiseAt] (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\promise.js:868:14)
    at Promise$_settlePromises [as _settlePromises] (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\promise.js:1006:14)
    at Promise$_rejectPromises [as _rejectPromises] (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\promise.js:999:10)
    at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\async.js:74:12)
    at Async$consumeFunctionBuffer (C:\Users\purplecones\AppData\Roaming\npm\node_modules\meteor-now\node_modules\bluebird\js\main\async.js:37:14)

C:\Users\purplecones\meteor-test>^G

The problem as expected is the split command. We might have to use something like this package and bundle it with meteor-now since I don't believe there is an equivalent command on windows.

@purplecones
Copy link
Collaborator

I've started a branch to split files with node. Looks promising so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants