node.js,mongodb,express,mongooseRelated issues-Collection of common programming errors
Sean
javascript node.js gruntjs livereload
PC Specs: Windows 7 Enterprise x64I’m running grunt.js on a project and recently started receiving an error when attempting to run ‘grunt watch’.Grunt worked fine yesterday but today I started seeing:Running “watch” task Waiting…Fatal error: listen EACCESI read another question here: Cloud 9 and Grunt.jsthat lead me to remove ‘options: {livereload: true}’ from Gruntfile.jsrunning watch again works as intended. Is there a way to reconfigure grunt or livereload to get livereload working with G
kisna
node.js gruntjs
Hi for responsive images i downloaded project from https://github.com/andismith/grunt-responsive-imagesi installed all those things what they have mentioned…whenever i say grunt it saying fallowing error:Running “jshint:all” (jshint) task>> 3 files lint free.Running “clean:tests” (clean) taskCleaning “tmp”…OKRunning “responsive_images:default_options” (responsive_images) taskFatal error: spawn ENOENTwhy i am getting this error pla tellme…Thnk you.
umerk44
node.js git
I got this error.stderr: fatal: Not a git repository: ‘C:/Users/DELL/SparkleShare/test4’When i run app.js file from command line using node command.Here is config.js file where repository is added.exports.sessionSecret = ‘JustSomeRandomString’;exports.folders = [{ type: ‘git’, name: ‘Public GIT folder’, path: ‘C:/Users/DELL/SparkleShare/test4’, pub: true } ];exports.listen = {port: 3000,host: null };exports.https = {enabled: false,key: ‘/path/to/private.key’,cert: ‘/path/to/cert.crt’ };exports.b
sobering
node.js ubuntu knockout.js gruntjs npm
Running a totally fresh instance of Ubuntu 13.10 x64 on DigitalOcean. Every time I try and build Knockout.js using npm/grunt I get the following error:Running “clean” taskRunning “checktrailingspaces:main” (checktrailingspaces) taskRunning “build:debug” (build) taskRunning “build:min” (build) task Compiling…Fatal error: spawn ENOENTThe strange part is, the Fatal error is seemingly random. It is always one of these three:Fatal error: spawn ENOENT Fatal error: spawn EPIPE Fatal error: spawn ECON
cathulhu
node.js cmd npm brackets adobe-brackets
I want to create window installer but facing some problem from last 4 days on exectuion of common.js facing this error.What i analyzed: child = child_process.spawn(cmd, args, opts); children.push(child); ..is not executing properly. Can someone help me?Regards
orustammanapov
node.js gruntjs grunt-contrib-watch
i should probably point out that i’m inexperienced user first, and my issue is that the ‘hostname’ property can’t have any values assigned except for an empty string(”), ‘0.0.0.0’ and ‘localhost’. I getting: Fatal error: getaddrinfo ENOTFOUND. What am i doing wrong?If get it right, i can change the adress that i’m usually typing in the address bar, so instead ‘localhost’ i could have typed ‘example.com’ or something like that. As i mentioned above i’ve assigned it different values but only thre
Mezzarine
node.js oracle
I followed the instalation guide and still doesn’t work.I haven’t been able to figure out what I’m doing wrong.node-gyt rebuild works fine when I do it.Any enlightenment is welcomeOS: Win 7Console:C:\TRIVIA>npm install oracle npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No README data> [email protected] install C:\TRIVIA\node_modules\oracle > node-gyp rebuildC:\TRIVIA\node_modules\oracle>node “C:\Program Files (x86)\nodejs\node_modules\npm\bin
Attila Györffy
node.js npm
I’m trying to install NPM packages on Ubuntu (12.04). I’ve installed Node.js and NPM via Chris Lea’s PPA repository.I’m trying to deploy the Uptime project to my server. I’ve cloned the application from GitHub, then trying to install the application dependencies as a root user:root@dev:/web/my-application# npm install -g npm http GET https://registry.npmjs.org/mongoose/2.5.11 npm http GET https://registry.npmjs.org/express/2.5.0 npm http GET https://registry.npmjs.org/ejs/0.6.1 npm http GET http
Stefan Manastirliu
node.js ubuntu-12.04 npm
I’m trying to install some node packages through npm, but it won’t go. I’ve already tried to install/unistall/update node, but nothing seems to work.Any help is really apprecieted!I’m using ubuntu 12.04 – Here is how i’m trying to install packages:npm install underscorenpm http GET http://registry.npmjs.org/underscore npm http 404 http://registry.npmjs.org/underscore npm ERR! registry error parsing json npm ERR! SyntaxError: Unexpected token < npm ERR! <html> npm ERR! <head> npm
Muhammad Reda
mysql node.js
I am very new to this node.js and ubuntu.Now i am trying to use mysql database in my application.For i have the following code:var mysql = require( “db-mysql” );new mysql.Database({hostname: “localhost”,user: “dave”,password: “asdfa”,.database: “dbNameHere”}).on( “error”, function( error ) {console.log( “ERROR: ” + error );}).on( “ready”, function( server ) {console.log( “Connected to ” + server.hostname + ” (” + server.version + “)” );}).connect( function( error ) {if ( error ) {console.log( “E
Adam Lynch
php apache mongodb installation wamp
I’m trying to execute this:<?php// connect $m = new Mongo();?>But I get the following error:Fatal error: Class ‘Mongo’ not found in C:\wamp\www…..Info:PHP: 5.38 MongoDB: mongodb-win32-i386-2.0.2 MongoDB PHP Driver: mongo-1.1.4-php5.3vc6ts WampServer: 2.2 OS: Windows 7 Enterprise SP1I’ve followed the MongoDB installation fine (incl. adding the DLL to ext & php.ini), I’ve started mongod.exe and WAMP is running.What does this imply is missing/incorrect?Edit:I have got it running
koslibpro
mongodb cakephp
i’ve installed the MongoDB plugin datasource into my cakePHP app,but when i try to use it,i face the following Fatal error:Fatal ErrorError: Class ‘Mongo’ not found File: /path/to/app/lib/Cake/Model/ConnectionManager.php Line: 107Do you know what might be wrong? I have configured correctly all the database settings and installed this plugin: https://github.com/ichikaway/cakephp-mongodb/Any recommendations are very welcomed..
TheRealPapa
mongodb ubuntu-12.04
I am running an instance of Ubuntu 12.04 on Amazon EC2. I have installed MongoDB following these instructions and these instructions. Following this, the Mongo shell starts OK.When I execute the following command inside a PHP script, I get the “Class not found” error.try {// a new MongoDB connection$conn = new Mongo( “mongodb://user:[email protected]” );I have followed instructions here and created ini file, but problem persists. I have also uninstalled and reinstalled per this link,
Jean Paul
mongodb
I’m using Windows 7 64 bit with XAMPP for Windows and can’t seem to find the solution to the issue with the installation. I have gone through the Windows and PHP driver installation guides at MongoDB.From PHP info my environment specs: XAMPP 1.7.7 PHP: 5.3.8 Apache 2.0 HandlerDoes anyone have an idea how to finish the installation? I have read tons of peoples comments and tried different troubleshooting and workarounds but nothing worked so far for me.I am doing the following steps:Downloading t
Chris Travers
django mongodb heroku
I have a Django app (music streaming service) running on a free hosting account on Heroku with a Postgres database with one web dyno. Yesterday I wrote a script that uploads mp3 files to Heroku, extract meta data, then upload it the files to Amazon S3. When I’m going through this process, I get this error when I try to refresh could not fork new process for connection: Cannot allocate memoryor FATAL: remaining connection slots are reserved for non-replication superuser connectionsWhen I go to p
Elnur Abdurrakhimov
php mongodb symfony2 doctrine2 symfony-2.0
I’m following the directions here: http://symfony.com/doc/2.0/bundles/DoctrineMongoDBBundle/index.htmlI have installed deps:#deps [doctrine-mongodb]git=http://github.com/doctrine/mongodb.git[doctrine-mongodb-odm]git=http://github.com/doctrine/mongodb-odm.git[DoctrineMongoDBBundle]git=http://github.com/symfony/DoctrineMongoDBBundle.gittarget=/bundles/Symfony/Bundle/DoctrineMongoDBBundlethen did $ php bin/vendors installI added the following:# app/autoload.php $loader->registerNamespaces(array(
Micku
php mongodb
I am using php and mongo db… I want to get user details using userkey which is a uniquekey.. My mongo query is :$obj= $mongo->user;$filter = array(‘userkey’=>$value);$exist = $obj->findone($filter);When i execute this query, am getting error as ..Fatal error: Maximum execution time of 30 seconds exceeded in line 5 ie $exist = $obj->findone($filter); shows errorHow to solve this problemCan someone help me plz…
Ramakrishna
php mongodb mongodb-php
I have installed rockmongo in my ubuntu from this site.When I tried to open the rockmongo from browser it showing fatal error as like mentioned below.Error:Fatal error: ini_set(): To prevent data corruption, you are not allowed to turn on the mongo.native_long setting on 32-bit platforms in Unknown on line 0How can i resolve this issue,can anyone give me a solution for this issue.
jSmith
php mongodb
I’ve seen this error a couple of times, and to fix it, I just reboot my server.Fatal error: Uncaught exception ‘MongoConnectionException’ with message ‘Failed to connect to: localhost:27017: Previous connection attempts failed, server blacklisted’ in /var/www/html/include/config.php:9 Stack trace: #0 /var/www/html/include/config.php(9): MongoClient->__construct(‘mongodb://local…’) #1 /var/www/html/classes.php(3): include(‘/var/www/html/i…’) #2 /var/www/html/myusers.php(8): include(‘/var/w
zenoexo
mongodb heroku playframework morphia mongolab
Setup, Play 1.2.4 with Morphia 1.2.6a and a MongoDB on MongoLab (not via add-on)UPDATE Look to bottom of question for explanation.Running on my local box in Prod and play serves pages with no errors. Pushed up to heroku and the database is throwing below. Other than any database transactions, play is working fine.2012-03-30T23:17:57+00:00 app[web.1]: Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: invalid ObjectId [4] 2012-03-30T23:17:57+00:00 app[web.1]: at com.goog
Julius F
node.js postgresql asynchronous express
One of the advantages of NodeJS is its async and non-blocking I/O, which in my case is great on the one hand, but breaks my neck every day on the other hand.I consider myself a NodeJS / Async novice and I often end up having such code:function(req, res) {req.assert(“name”, “Lobbyname is required”).notEmpty();req.assert(“name”, “Lobbyname length should be between 4 and 64 characters”).len(4, 64);req.assert(“game”, “Game not found”).isInt();req.sanitize(“game”).toInt();var userId = req.user.id;var
Asya Kamsky
javascript node.js mongodb express mongoose
I am developing a web application with Node.js and MongoDB/Mongoose. Our most used Model, Record, has many subdocument arrays. Some of these, for instance, include “Comment”, “Bookings”, and “Subscribers”. In the client side application, whenever the user hits the “delete” button it fires off an AJAX request to the delete route for that specific comment. The problem I am running into is that, when many of these AJAX calls come in at once, Mongoose fails with a “Document not found” error on some
guypursey
linux node.js express socket.io
I’ve just installed Node JS (v0.10.0) on a netbook running Linux Peppermint Three. I have a file to run which has the following at the top:var app = require(‘express’).createServer(),io = require(‘socket.io’).listen(app);app.listen(8080);// routing app.get(‘/’, function (req, res) {res.sendfile(__dirname + ‘/index.html’); });The problem is that when I visit localhost:8080 I get the following:TypeError: Arguments to path.join must be stringsat path.js:360:15at Array.filter (native)at exports.join
QlliOlli
node.js rest express mongoose
I’d need some help on setting up my rest routes in Node + Express.My problem is as follows:controller.js:module.exports = {findAll: function(req, res) {var users = User.findAll();res.json(users);}};User.js:module.exports = {findAll: function(req, res) {userModel.user.find(function(err, user) {if (!err) {console.log(user);} else {console.log(err);}});}};This console.logs me the users as expected, but if I change the console.log bit to return: findAll: function(req, res) {return userModel.user.fin
Tronic
javascript mongodb node.js express mongoose
i use express.js with mongoose for mongoDB access. i try to implement a fallback, if someone enters an url which does not exist (based on the user_id). here’s the code:app.get(‘/track/:id’, function(req, res) { var user_id = req.params.id; User.findById(user_id, function(err, user_) {if (!err) {res.render(‘track’, { pins: user_.pins, layout: false });} else {res.send(“FAIL! ” + err);} }); });when accessing http://foo.bar/track/1234 and 1234 doesn’t exist, it should print out FAIL!, if the id exi
elspiko
node.js azure express
So I’ve got an express site running on Windows Azure. I’m currently having problems submitting forms that are marked as enctype=”multipart/form-data”.The error I’m getting in the logs is: TypeError: Object # has no method ‘tmpDir’When running natively (initiated via node.exe) it works absolutely fine, its only when using the AzureEmulator or on Azure itself it fails.Now I expect this has something to do with Azure’s infrastructure, but I’m wondering whether anyone has managed to work around this
Cordon Davies
node.js mongodb express swig openshift
I am trying to get my node/mongo/express app working on Openshift. It works locally, but on Openshift I am getting an Error: Cannot find module (‘swig’) I have added it to my dependencies in the package.json as shown below.”dependencies”: { “bcrypt-nodejs”: “~0.0.3”, “consolidate”: “~0.9.1”, “express”: “>=3.x”, “mongodb”: “~1.3.9”, “swig”: “~0.14.0”, “validator”: “~1.1.3” }, “devDependencies”: {}, “bundleDependencies”: [],And I require it in my server.js like so:var swig = require(‘swig’); va
cpeele00
javascript node.js mongodb express
I’m trying to get some data to save into MongoDb. I followed the following example beforehand and verified that it works, however now that I’m trying to write my own test app using this “format” it’s not working. MongoDb does not throw any errors and I can even retrieve the doc _id from the insert callback. However when I go into the Mongo shell, the collection doesn’t even exist let alone the document.Here’s the example I followed originally just so you can get a feel for the way I tried to mim
EternallyCurious
jquery express typescript
I have a project that uses NodeJS + Express + JQuery + Typescript. I am uploading a file from the front end which happens successfully. However I’m not able to return a JSON object back from the server to the client which contains the location of the object on the server. When the JSON data returns to the client it actually renders (the JSON) on the screen instead of being received by the “success: function (response)” function on the client side.Here’s the client side code:function sendFile() {
Chakravarthy S M
javascript node.js mongodb express jade
In my Jade view I have “raw” which contains retrieved mongodb data which I have passed to my jade view by res.render(‘jadeview’,{raw:mongodbdata})body .containerh1 View Requests Pagetabletbodytrth IDth Request’sth Descriptionth Current Status – if(raw.length)each item in rawtrtd a(href=’/individualrequest/#{item._id}’, id=”idanch”) #{item._id}td a(href=’/individualrequest/#{item._id}’, id=”rqstanch”) #{item.request}tda(href=’/individualrequest/#{item._id}’, id=”descanch”) #{item.descr
fdior
node.js mongodb socket.io mongoose
I’m having weird issue with IE9 when reloading an existing tab pointing to my nodeJS server http://localhost:8080/ :mydb.usermodels.$userId_1 dup key: { : “d268745fbe9” }Opening a new tab in IE9 and loading the same URL does not generates such error, and Firefox lets me reload the same tab with no error at all.Basically, when the tab is load (or reload) the client generate a random user ID and send it to the server over a socket.io socket. The server then checks if userId is present in database
Asya Kamsky
javascript node.js mongodb express mongoose
I am developing a web application with Node.js and MongoDB/Mongoose. Our most used Model, Record, has many subdocument arrays. Some of these, for instance, include “Comment”, “Bookings”, and “Subscribers”. In the client side application, whenever the user hits the “delete” button it fires off an AJAX request to the delete route for that specific comment. The problem I am running into is that, when many of these AJAX calls come in at once, Mongoose fails with a “Document not found” error on some
QlliOlli
node.js rest express mongoose
I’d need some help on setting up my rest routes in Node + Express.My problem is as follows:controller.js:module.exports = {findAll: function(req, res) {var users = User.findAll();res.json(users);}};User.js:module.exports = {findAll: function(req, res) {userModel.user.find(function(err, user) {if (!err) {console.log(user);} else {console.log(err);}});}};This console.logs me the users as expected, but if I change the console.log bit to return: findAll: function(req, res) {return userModel.user.fin
justinhj
node.js mongodb mongoose
I’ve been evaluating Mongoose (an ORM for node.js which uses MongoDB for persistent storage).What I’d like to do is make sure that the app can run when the DB is not up when the app starts, and also handles the DB going down intelligently. Currently my test app which does not work in either case does this:var mongoose_connection = mongoose.createConnection(DATABASE_URL, {server:{poolSize:4}});Then I use that connection when making Models.In the case when the DB is down at the start of the app th
Tronic
javascript mongodb node.js express mongoose
i use express.js with mongoose for mongoDB access. i try to implement a fallback, if someone enters an url which does not exist (based on the user_id). here’s the code:app.get(‘/track/:id’, function(req, res) { var user_id = req.params.id; User.findById(user_id, function(err, user_) {if (!err) {res.render(‘track’, { pins: user_.pins, layout: false });} else {res.send(“FAIL! ” + err);} }); });when accessing http://foo.bar/track/1234 and 1234 doesn’t exist, it should print out FAIL!, if the id exi
Suresh
mongodb mongoose mongodb-query
The minimum sensible number of voting nodes to a replica set is three. MongoDB replication is synchronous. The Mongo shell is capable of attaching to a replica set and automatically failing over. By default, using the new MongoClient connection class, w=1 and j=1. The oplog utilizes a capped collection.I have selected 1,3,5 in answers but still get wrong answers. can anyone help me which one is right options for replication?
Rosarch
mongodb mongoose
I’m messing around with Mongoose, and I’m noticing that my find callback is being called multiple times when saving an invalid item:persist.jsmongoose.model(‘ContentTag’, new mongoose.Schema({content: requiredString,tag: requiredString }));test.js (using mocha)describe(‘content tag’, function() {it(‘should not save an empty content tag’, function(done) {persist.ContentTag().save(function(err) {assert.ok(err);persist.ContentTag.find(function(err, items) {assert.equal(0, items.length);done
Matthew Clark
javascript node.js schema mongoose
Using Mongoose.js with node.js. I have this schema:var Photo = new Schema({URL:String,description:String,created_by:{type:ObjectId, ref:’User’},created_at:{type:Date, default:Date.now()} });var User = new Schema({name:{type:String,index:true},email:{type:String,index:true, unique:true} });//Task model var Task = new
BRValentine
node.js mongodb csv coffeescript mongoose
I’m using node-csv-parser to read in csv data and store it in mongodb using mongoose. However I’m trying to speed up the import, and I want to evaluate using the native save method exposed by node-mongodb-native, accessed in mongoose using Model.collection. (This at the advice of a mongo engineer I spoke to at office hours at Mongo HQ).node-csv-parser fires a data event every time it reads in a new line of the csv. Inside this event I read in the line of data, create a new data point from it, an
Nahn
mongodb mongoose node-mongodb-native
Our MongoDB setup uses three replica set shards. Each webserver runs a mongos instance locally, and the client node.js processes connect through that using Mongoose (3.6.20) and node-mongodb-native. So node-mongodb-native just connects to mongos on localhost.When a replica set primary goes down hard (we can simulate this by doing ‘ifdown eth0’ on the primary) mongos properly detects this, and also detects that a new primary has been elected. So far, so good. But node-mongodb-native’s connections
Web site is in building