msolters / meteor-particle-skeleton

A barebones Meteor app implementing the Particle cloud.
0 stars 1 forks source link

npmRequire issues #1

Open Dimicus opened 8 years ago

Dimicus commented 8 years ago

Dear @msolters

I am trying to include your skeleton to my meteor app. I can see references in the code to "spark" but now its particle and i think that might cause issues since i download the particle-api-js package

Is there a chance to get a updated package to this since i see it as a good place to start to learn how to work with the particle-api-js package. its an easy and fast example.

BR Dimi

msolters commented 8 years ago

The problem is that if you are making a new app, it will be using Meteor 1.3. One of the big changes in 1.3 is how NPM modules are imported. NPM is now directly integrated into the Meteor stack.

You are also correct it seems (I no longer use Particle) that the API has changed.

So if you're making a new app, just run the following command.

meteor npm install particle-api-js

Now the particle-api-js NPM package has been added to your Meteor app. To use the API in your code, the syntax is (this is ES6, which is also something new in 1.3):

import Particle from 'particle-api-js';

That code is the Meteor 1.3 equivalent to the usual:

var Particle = require("particle-api-js");

You now have access to the full Particle API.

Again, this is all untested because I haven't used the Particle API in quite a while but it should work as advertised.

Mark

On Mon, Mar 28, 2016, 7:36 AM Dimicus notifications@github.com wrote:

Dear msolters.

I am trying to include your skeleton to my meteor app. Since i dont know exactly how to do i created a new map and made a git copy of your files but when i try to start the meteor map i get this error. W20160328-13:13:53.392(2)? (STDERR) TypeError: Object [object Object] has no method 'npmRequire' W20160328-13:13:53.392(2)? (STDERR) at particle-example.js:7:18

I can see references in the code to "spark" but now its particle, can it have anything to do with that? Also i can see that you mention that there is json file as a comment in the .js file that contains what npm pagacke that is needed to install but there is no json file.

Is there a chance to get a updated package to this since i see it as a good place to start to learn how to work with the particle-api-js package.

BR Dimi

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/msolters/meteor-particle-skeleton/issues/1

Dimicus commented 8 years ago

Hello msolter and thank you so much to returning to me.

I have actually been able to code some, made a login and got event that i store in a database, almost as your example.

Since i have been able to atleast start i can continue to ask the questions i have on the forum's so i dont have to bother you here :) When im done i will try to make some tutorial from my experience since i see alot of people is asking about the particle-api-js, i also see that they will make examples, its stated on issues under particle-api-js GIT page :)

Thank you so much for taking time.

/Emil