meteor js 1.7.0.5 wont access database on mac - javascript

I am a noob to meteor and have tried very hard to follow some tutorials on getting mongodb access to work. I have installed meteor 1.7.0.5 on a mac and have tried to run the https://www.meteor.com/tutorials/react/creating-an-app tutorial up to step 3. I can see my data in the meteor mongo console, but it does not appear in my web app even though I have followed the instructions up to step 3. weirdly I have managed to get exactly this same code working on a raspberry pi.
I was looking at meteor as a possible alternative to firestore, but the problems are starting to put me off of wanting to use meteor js in future projects.

Related

Electron NPM application cannot find file:///eel.js, but python can

I'm building a desktop application using Python, JS, HTML and CSS. I'm connecting python using eel. When I launch my desktop application through the python terminal, it works perfectly.
However, when I launch the app through electron via command line:
$npm start
The desktop application loads up, but it doesn't execute on any of the python backend, explained well by this error in the inspector:
Failed to load resource: net::ERR_FILE_NOT_FOUND eel.js:1
I'm not sure what is causing it, I have spent the last 8 hours testing things but to no avail.
I know you may need more information but I've been checking everything, from file structure i.e. the __.py outside web folder, to inserting <script type="text/javascript" src="/eel.js"></script>, so please comment below what specifically you require as including every possible cause would be a very huge question. I will include whatever is relevant in edits in this question alongside the final answer for anyone with similar issues in the future.
No need to run from npm. eel.js is just virtual javascript, dont bother with it.
Put this in your your_main.py file
import eel.browsers
asign your electron browser
eel.browsers.set_path('electron', 'node_modules/electron/dist/electron')
and then use it
eel.start('main.html', mode='electron')
to run, call from python:
python your_main.py

Meteor - QR Code generation on meteor server

I have been searching for generating QR Code on Meteor Server.
But so far I have found the libraries which works only on Meteor Client.
So is there any library for Meteor which can generate QR Code on Meteor Server side?
I am a novice at Meteor and I have NOT TRIED this solution, but it seems plausible.
At the core of Meteor is NodeJS which has many more solutions available than you'll find for Meteor in Atmospheres, including QR code image generation. #Arunoda seems to have "hacked" together a way to run most anything under NPM...
https://atmospherejs.com/meteorhacks/npm
Once you have that working, you can probably use this handy NodeJS QR Code library...
https://www.npmjs.com/package/qrcode-npm

Unexpected mongo exit code 100 with Meteor

I am trying to follow this answer:
https://stackoverflow.com/a/15752736/4167140
But the path /usr/local/meteor does not exist on my OSX. I ran a single Meteor app on my machine for months and it worked fine, but now that I have multiple meteor apps on my mount, I keep on getting...
Unexpected mongo exit code 100. Restarting.
...when I go to run any of the apps locally (aside from the first one I created).
Did I install Meteor incorrectly? I curl'd it down and I have the executable in /usr/local/bin/meteor, but I need to be able to access /usr/local/meteor in order to get verbose logging when I run mongod inside of the directory.
This happens even on Meteor applications that dont have any collections (just static content).
I have never run into this issue with any of the Meteor + MongoDB applications that I run on my Ubuntu boxes.
Before of to check the installation of Meteor, you could see in your app directory if there is any mongodb.lock, in that case just delete it with rm .meteor/local/db/mongodb.lock (that path is on my linux, maybe it can change a bit, so please check it)
did you try this? There's a bug on github for it...
https://github.com/meteor/meteor/issues/2772
Hey, I don't really have enough to go on for a good answer. But, the .lock file isn't the database. It's a file mongodb writes to prevent itself from starting again on your database. That would get messy. If mongodb crashed, and didn't delete the .lock it wouldn't start again without manual intervention.

Use Meteor without its templating library

I'm building an app that uses only Polymer to structure the frontend. As a backend I'd really like to use Meteor with their Mongo realtime database.
I only need the part of Meteor that implements the DDP prototcol and provides the Mongo API to the client. Is it currently possible to remove the rest of the client libraries? I don't need jQuery, Blaze, Tracker and so forth.
I've already tried removing meteor-platform from the project, then adding all the packages meteor-platform consists of. This results into errors like ReferenceError: Meteor is not defined. It seems like this is not supported currently.
What I then used was Asteroid which is really nice. But using it prevents me from using Meteor packages like GroundDB for example.
Reading on the Meteor website gives me the feeling that it should be possible to use only some parts of Meteor, but this doesn't work for me.
What's the best way to tackle this problem?
Edit: I've uploaded a leaderboard example with the failing setup on GitHub. Meteor.isServer is causing the error. If you comment out the server stuff it works.
You're missing two packages:
meteor add meteor underscore
The meteor package is the one that exposes Meteor.isServer.

Why do frameworks and git hub ask you to use Terminal?

I'm a newbie and that's ok.
But when I use tutorials, they always tell me to go straight to my terminal and install documents from there in which I have no clue what the next step is and no idea why I have to do it. Is it essential that I install frameworks through terminal or can I just work without it?
ex. http://net.tutsplus.com/tutorials/javascript-ajax/real-time-messaging-for-meteor-with-meteor-streams/
"Let’s create a very simple, browser console based chat application with Meteor Streams. We’ll first create a new Meteor application:"
meteor create hello-stream
I understand this is may not be very challenging, but I don't have a clear answer when I try and simply google it. Anything would help, thanks a lot!
Being a newbie is ok.
The terminal is the go to because writing programs, tools, and scripts with a couple lines of bash or python is, well, a couple of lines versus an entire gui and all the lines of code to go with it.
meteor create hello-stream
That's telling you to run the program called meteor with the supplied arguments (create hello-stream).
If you haven't installed meteor, do that next. From their website, open your terminal and type/paste:
curl https://install.meteor.com | sh
That downloads a file from the URL and pipes (|) it to the sh command. The file it downloads is a shell script that takes care of setup/installation. Now go back and try the meteor command again.
More reading
You might try and find a terminal tutorial. This is the first one I found:
http://www.ee.surrey.ac.uk/Teaching/Unix/
Answer from someone who only recently (as in: within the last year) got into using the Terminal more and more frequently:
It's generally a good idea to get used to using the Terminal for code-related things as you can pretty much use it platform-independently (meaning you can use the same commands on Mac, Linux, Windows,...) and because it makes you understand better what you're actually doing.
Once you've got the hang of it, it can make navigating your system as well as making changes to it easier. Hidden files, for example (like .gitignore files, or files in your .ssh directory, or your .bash_profile), can be viewed, opened and edited easily from the Terminal whereas you have to take multiple, complicated steps (or install other software) to view them from your Finder.
With the help of package managers (like Homebrew), which are also operated from the Terminal, you can also install software that isn't otherwise available for Mac.

Categories