Bren
Bren

Reputation: 273

Meteor for Windows in WebStorm

I am learning how to use Meteor in Windows (just installed the preview released last week). I'm using WebStorm

I ran through the instructions on page 1 of this tutorial (https://www.meteor.com/try) and can see the fully rendered website at http://localhost:3000. However, when I follow the instructions and paste the code directly from page 2 (https://www.meteor.com/try/2), the website does not load properly. The code is:

<!-- simple-todos.html -->
<head>
  <title>Todo List</title>
</head>

<body>
  <div class="container">
    <header>
      <h1>Todo List</h1>
    </header>

    <ul>
      {{#each tasks}}
        {{> task}}
      {{/each}}
    </ul>
  </div>
</body>

<template name="task">
  <li>{{text}}</li>
</template>

// simple-todos.js
if (Meteor.isClient) {
  // This code only runs on the client
  Template.body.helpers({
    tasks: [
      { text: "This is task 1" },
      { text: "This is task 2" },
      { text: "This is task 3" }
    ]
  });
}

The instructions say I should see:

Todo List This is task 1 This is task 2 This is task 3

Instead, I see:

Todo List {{#each tasks}} {{> task}} {{/each}}

Somehow the Meteor code is not being recognized. Am I missing a step? I thought it might have something to do with the Windows release, but the first case loaded fine.

Thank you.

Brendan

Upvotes: 1

Views: 899

Answers (2)

Dan Dascalescu
Dan Dascalescu

Reputation: 151747

You don't need to run Vagrant or figure out Nitrous.io. Meteor and WebStorm work just fine on Windows. See the video at http://meteorpedia.com/read/Webstorm. You don't need to start meteor separately either.

Here's how to run the http://meteor.com/try example:

  1. Install Meteor for Windows if you haven't already. If you have, delete the folder %USERPROFILE%\AppData\Local\.meteor and install the latest preview again.
  2. Start WebStorm
  3. Create a new project, choose type Meteor.js app, then "default".
  4. Run -> Run -> Edit configurations
  5. Click the + to add a new configuration of type Meteor
  6. Call it simple-todos for clarity (this is optional)
  7. Click Run

Notice how Webstorm starts a console within the IDE, which shows the familiar Meteor startup sequence:

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/

If you're prompted for any firewall permissions, make sure to allow all traffic from Node.js.

Since you created the project from WebStorm, files won't be named simple-todos.*, but rather hello.*. I've just filed an issue about that.

Also, the steps to create a configuration won't be necessary, thanks to another issue that's been filed.

Upvotes: 1

GUISSOUMA Issam
GUISSOUMA Issam

Reputation: 2582

I used a virtualised solution to work with meteor on windows, for some reason the windows version of meteor don't work as expected, I got a lot of unexpected errors...

I suugest you to use vagrant with your WebStorm if you want to be on windows.

I made small video to show how it works with IntellijIdea and must be the same for WebStorm.

Here the video https://www.youtube.com/watch?v=woFUR1dMZ3g

Upvotes: 0

Related Questions