Tagged Questions
Node.js is an event-based, non-blocking, asynchronous I/O framework that uses Google's V8 JavaScript engine and libuv library. It is used for developing applications that make heavy use of the ability to run JavaScript both on the client, as well as on server side and therefore benefit from the ...
0
votes
0answers
2 views
Updating and fetching only few items from database entry not working in mongodb
I have a code defined as
var parentFieldsRequired = {__v:0 , password:0, deviceToken:0, deviceType:0, creationDate:0, updated:0};
var timeStamp = Math.floor(Date.now() / 1000).toString();
...
0
votes
0answers
2 views
mongodb - findoneandupdate error on insert
I have a problem with findOneAndupdate, if I start the server, then I drop the collection then I run findoneandupdate all work, the document was created, if now I drop the collection and the I run ...
0
votes
1answer
9 views
TypeError is not a function
I'm currently playing around with Nodes.js and creating a simple bot as a proof on concept. I'm using the discord.js package.
I have the following codes
// FluffBot class initialisation
var FluffBot ...
0
votes
0answers
5 views
Bootstrap4 & Autoprefixer without node.js
Someone can tell me how upload and run Bootstrapv4 with Autoprefixer (install on server)? I can do that only with npm/node.js or other but maybe
there is a way upload nad run It without all other ...
0
votes
0answers
6 views
alert certificate unknown 46 when using apple push notifications
I use apn on a nodejs app with node-apn. When I try to send the notification I got the following error:
Error: 139874953426816:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate ...
1
vote
1answer
19 views
socket.io with Angular doesn't display message instantly
I am trying to create instanse message app (chat) using socket.io and Angular.
I have 2 files: index.html, and index.js showed below.
the chat works fine expect that when I press on the "Send" button ...
0
votes
0answers
10 views
Can I use nodemailer in browser?
I've created a simple react redux app (using webpack) with a contact form which when the user clicks submit I want to generate and send an email. To do this I have been trying to use nodemailer like ...
0
votes
1answer
44 views
Split JavaScript(nodeJS) string into fixed sized chunks
I want to split a string into fixed sized chunks (say 140 characters each) in JavaScript using space as delimiter(i.e it should not break words), Note: It should handle newline character
Currently I'm ...
0
votes
0answers
5 views
Does NodeJS install API documentation on Mac OS X and if so, where?
I've installed node on my Mac but I'm still not familiar with Mac ways.
I can't seem to find where it installed the documentation. My internet connection is flaky.
Is it installed somewhere in the ...
0
votes
0answers
9 views
Mongoose POST Validation Error - Using GeoJSon wtih MEAN and Google Maps API
I'm trying to realize an application using Google Maps API, MEAN + Mongoose and GeoJson for geographic data.
I would like to post in my mongodb db 3 different kind of objects:
Points, Polygons ...
0
votes
0answers
13 views
How to use Node.js to process large objects in array with more memory efficient.
I have a list of urls which I needs to process to put that back in Elasticsearch. The list is about 400k. Which I can use Node.js to run without any problem.
Now after I get all the lists I need to ...
0
votes
0answers
6 views
How to handle FormData from express 4
I tried sending some form data to my node server but req.body has none of my form fields the node side
var express = require('express')
var app = express()
var path = require('path')
var bodyParser ...
0
votes
0answers
7 views
Node command line silently ignores undefined function errors in Promise block [duplicate]
Any function that isn't defined in new Promise(){} section will be silently ignored and causes program stop without any log in console.
How can I enable error logging for such errors?
function ...
0
votes
1answer
14 views
Angular communication with back-end
I'm trying to create an authentication-service in angular in order to register/login users.
After registering a new user I have some trouble receiving the response to the service.
Here is the flow:
...
0
votes
0answers
9 views
AWS Lambda getting error “Cannot find module 'gm'” in node.js 4.3
This is my first lambda function on AWS.
I just want to convert a JPG on S3 to a PNG. So far I've got this:
'use strict';
let aws = require('aws-sdk');
let im = require('imagemagick');
let s3 = new ...
0
votes
0answers
3 views
webpack - copy all images from image folder and paste to new destination
I'm using file loader to take images from css path and paste it to build folder. But that lefts out images that the website needs but they are not in css files.
I want to copy all images in image ...
0
votes
0answers
4 views
Why there are multiple connection to a database when using cluster module nodejs
I am using NodeJS cluster module and forking up the NodeJS process so that I can take advantage of multprocessor environment.
I understand that one application should have a single DB connection so ...
0
votes
2answers
13 views
ValidationError: “expiresInMinutes” is not allowed NodeJs JsonWebToken
I am using NodeJs with JsonWebtoken Module.
I am facing this error when calling sign method of json web token
ValidationError: "expiresInMinutes" is not allowed
var jwt = ...
0
votes
0answers
7 views
Handlebar First letter upper case and replace the _ in same string
ucwords(str_replace("_", " ", "email_validation"));
This method how read write in handlebar node js
0
votes
0answers
18 views
Show user's location to another user on Google Maps
My goal is let say if user A toggle the switch
When it is on, On User B's screen will show the current location of User's A
and whenever User A is moving to another coordinates, User B could see ...
0
votes
0answers
20 views
send data from Node route of Rest API response to Front END React Component directly. Not Ajax call
I have a REST API's and i am fetching data by route and displaying with Handlebars in my express project. After watching recent React release Documentation of v15.0 . renderToString is deprecated. So ...
0
votes
1answer
12 views
failed to combine socket.io with angularJS
I want to create an instance message (chat) app, using Socket.IO and angualrJS.
my code is below. for some reason, the var socket = io(); command "cancel" the angluar script. i.e. if I delete this ...
-1
votes
0answers
5 views
Node server setup shows error “can not find module” with appium
i installed node and npm with brew and also installed npm install -g appium but node server not running with appium
ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" ...
0
votes
2answers
10 views
Unable to start Node on system reboot Ubuntu Crontab
I have tried everything. Even tried it with adding the forever start code in /etc/rc.local didn't work.
When I use the @reboot keyword in /etc/rc.local it says @reboot cannot be found.
So I went ...
2
votes
1answer
14 views
How to redirect to a url along with making a post request to it in node js?
Basically what will happen is my angular page will make a post request to my express/node js application.
I want express on receiving that post request from angular to redirect to an other URL and ...
0
votes
0answers
7 views
Meteor.userId can only be invoked in method calls. Use this.userId in publish functions
i have an meteor built pretty huge application im getting this error
Meteor.userId can only be invoked in method calls. Use this.userId in publish functions
i'm not able to figure out from where ...
-1
votes
1answer
19 views
Socket io: Update data on separate page automatically on form submit without refreshing
If I have two pages open, one page showing a table of my data, and the other page containing a form for users to input new data, how do I go about using socket io to automatically update the page with ...
0
votes
1answer
13 views
app.get('env') usage in localhost and production
var express = require('express');
var app = express();
var db_url;
if(app.get('env') == "development"){
db_url = 'mongodb://127.0.0.1:27017/localhost';
}else{
db_url = 'something else';
}
...
0
votes
0answers
10 views
Unable to load 3d model from remote location in THREE.js
Unable to load stl model from a remote location in THREE.js, The developer console error was 'No 'Access-Control-Allow-Origin'
I set the headers in my nodejs server to allow cross-origin, but still ...
0
votes
0answers
11 views
Requiring compiled ES6 Modules from dist
I have two questions.
Question #1
I'm writing npm package on ES6 and have following package.json:
{
"name": "mypackage",
"bin": {
"mybin": "dist/bin/mybin.js"
},
"dependencies": ...
0
votes
2answers
13 views
Can't utilize static files w/ node.js and express
I'm trying to use node.js and express to create a chat client, but as soon as I try to use external CSS or JS files, I run into GET errors.
Currently I have index.js as:
var express = ...
0
votes
0answers
14 views
Unable to create websocket connection
I am new to WebRTC and WebSockets and was following this tutorial to create a WebRTC demo project, but I am unable to create a WebSocket connection. I have followed the same steps as mentioned in the ...
3
votes
0answers
32 views
insert document in array field
I'm not good at mongodb, so it is hard to manipulate sub documents. What I want to do is implement address book like this:
{
[[email protected]]: [
{
email: '[email protected]',
...
0
votes
0answers
5 views
sequelize error while syncing database - cannot find module bignumber.js
I am using sequelize + mysql in my project. I created a custom NPM module that contains sequelize models and provides some utility methods. And I am using this custom NPM module in another nodejs ...
-2
votes
0answers
7 views
I am using botkit module for a slack bot.How do I identify the user which is sending the message to the bot?
I am using botkit module for a slack bot.How do I identify the user which is sending the message to the bot ?
-1
votes
0answers
21 views
Successive validation of things via route overloading using next() in Node and Express … good practice?
Let's see ... I am experimenting with nodejs and express for the first time making a simple website and due to its asynchronous nature ended performing things such as the code below. As an example I'm ...
0
votes
1answer
12 views
loop a list of items in mongodb mongoose and do action based on the result
Hello I want to loop a list of games and find if any game is already inserted , if it is already present in database then skip , otherwise insert the new game into the database. Each game has an ...
-1
votes
0answers
29 views
Array data in javascript is undefined when inside function
I'm currently doing this in node.js and tabletop.js, and in the line commented with print1 shows the current content of facultyArr[0]. However, when inside the function, it shows undefined.
var ...
-1
votes
1answer
32 views
Array 'result' is ['o'] before return. After the return, it's [ ]. How?
I have this Tree exercise to return the next letter to suggest typing for a simplified search bar feature, where I have to implement the WordTree.prototype.search function. Here's the basic ...
0
votes
0answers
6 views
Unable to stop my computer from hosting a p5js sketch using Nodejs
I just started using Nodejs for Windows 8.1 to do some simple local hosting for some JavaScript sketches and I find that my computer will always host the JS sketch that I originally used unless I ...
-1
votes
1answer
28 views
Node.js TypeError: Wit is not a constructor
How to solve "Wit is not a constructor" error coming from Node.js while executing code given by node-wit and wit.ai documentation.
// Setting up our bot
const wit = new Wit(WIT_TOKEN, actions);
I ...
1
vote
1answer
14 views
What's the purpose of having express use webpack dev server?
I'm trying to understand the reason why one would like the webpack server for applications where webpack is bundling and serving the client side code and express for the api.
For example. I'd imagine ...
4
votes
2answers
28 views
How to update node modules programmatically
I need to use the npm update from a script. Below is my code:
var npm = require('npm');
npm.load(function () {
npm.commands.outdated({json: true}, function (err, data) {
//console.log(data);
...
2
votes
1answer
15 views
'express' command not found on mac
Definitely a noob question so please don't judge but this has been bothering me for a while.
No more how many times I run $ sudo npm install -g express-generator or $ npm install express -g, ...
0
votes
1answer
13 views
Getting Username from Slack API
I'm building a slackbot that needs to listen for an ambient keyword but checks to make sure a particular user wrote the keyword. I'm trying to test the command right now with this:
...
5
votes
0answers
13 views
Encapsulating methods behind Getters
I'm developing a website using the node.js/express stack and I'm trying to develop in the functional style which is pretty new to me. The express method res.send requires the function to be called as ...
0
votes
0answers
11 views
How to decouple backend app?
I have heard this term many times, and it makes sense in theory. That app is doing many things and it'd be easier to manage, scale, test and improve them if they are not completely connected to each ...
-1
votes
1answer
16 views
Asynchronous embeddable javascript widgets [on hold]
I have created chat application using node.js, socket.io and mongodb now I want to embed that chat in any website that I want by just adding small html and js code.
0
votes
0answers
4 views
Creating model in BeforeCreate remote hook
I have a model called SafeLink. I want to create an instance of the model on a remote hook of another model.
var app = require('../../server/server');
var sendgrid = ...
0
votes
0answers
7 views
How to run nightmare.js on google appengine for node.js
There is famous issue with nightmare and electron not running on headless linux servers. The official electron docs suggest to use xvfb in order to fake the display. They suggest to use this .yml file ...