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 re-...
0
votes
0answers
6 views
Sequelize in Node/Express - 'no such table: main.User` error
I'm trying to build a simple Node/Express app with Sequelize, but when I try to create a new record in my relational database, I am getting the error Unhandled rejection SequelizeDatabaseError: ...
0
votes
1answer
23 views
Is there a way to actually pause readline?
Consider the below code, input file and the results. The setTimeout is here to mimic an external call, such as http get. What is the best / simple way to keep the results in order? The obvious added ...
0
votes
0answers
4 views
Google Drive API Service Account inside domain
I have to download/upload/delete files from a folder on Drive with a Node.js server. That folder is inside the G Suite of the company, and only a few people in the company has access.
I have to use a ...
0
votes
0answers
5 views
IBM Bluemix Cloud: IBM SDK for Node.js - Can our apps in Bluemix keep the existing version without auto-updates?
We tried to test IBM Bluemix Cloud and Watson Cloud by running several Watson Cloud demo node.js apps inside our accounts, we noticed the following situation:
* After we installed the demo apps inside ...
0
votes
1answer
5 views
How to consume messages from RabbitMQ on nodejs
I am a new user trying to implement RabbitMQ on my nodejs code. I have referred couple of examples on using it but still unclear on how to use it with real time example. I am trying to use Rabbit MQ ...
-1
votes
0answers
4 views
Calling API Using fetch in reactjs
I'm calling webapi using fetch in reactjs with flux.
i'm able to call webapi if i'm using my url like http: //localhost:1046/#/" but if i'm removing # from url i'm not able to call the webapi i.e. '...
0
votes
0answers
3 views
Double association in Sequelize model
I have these associations
// Tasks.js
sequelize.models.tasks.belongsTo(sequelize.models.users, {
foreignKey: {
type: DataTypes.INTEGER,
field: 'ASSIGNEE',
allowNull: true
...
0
votes
0answers
9 views
npm -g ERR! extraneous
I've seen this in local node modules but not in global.
what is the cause and how can I prune these?
0
votes
0answers
6 views
Node MySQL - Finding last executed nested query in a loop (MySQL.js)
The code is a bit long so the short version is
i.API(options).then(function (results) {
var arrayBulk = []
_.forEach(results.lists, function (res, index, array) {
arrayBulk.push([
res....
-1
votes
0answers
7 views
How to make PayPal payment with Node.js
I am trying to make a test payment with credit card, but every time I get an internal error.
Firstly I create a card with paypal.creditCard.create method, provided by paypal-rest-sdk npm package. ...
0
votes
0answers
8 views
NodeJS Application that runs ADB functionality
Is there any way to create an application that includes the functionalities of ADB such as "pull/push/devices/install" that runs on all devices regardless of if they have the ADB package installed or ...
2
votes
0answers
21 views
Reference npm script from npm script
Consider the following example package.json fragment:
{
// ...
"scripts": {
"start": "npm run b -- --watch",
"build": "builder --in src --out dest"
}
// ...
}
In this, I ...
0
votes
0answers
6 views
Messages repeating on clients with NodeJS TCP API for a realtime call
I'm trying to implement a full duplex audio/video call between an android mobile device and an embedded device (raspberry pi) with the server logic written in NodeJS. Websockets is bulky and power ...
0
votes
0answers
19 views
Emit an event in Nodejs crash web app
I'm new to Nodejs. I'm trying to emit an event but my app crashes and I can't see error in console.
My code is the following:
const emitter = new events.EventEmitter();
//other code
emitter....
0
votes
3answers
21 views
Express next() error
I'm working with node+express+MongoDB.
I dont understand this error.
When I comment next() it's fine and works but when I use next() I'm getting the error: Error: Can't set headers after they are ...
0
votes
0answers
13 views
Cordova error: Refused to execute inline script because it violates the following Content Security Policy directive
I'm learning to use Cordova with jquery mobile and I have the following error:
Refused to execute inline script because it violates the following Content Security Policy directive: "default-src '...
0
votes
0answers
6 views
heroku node mongodb, `require is not defined`
I have a question about running my seedDB.js locally and in heroku. Currently I have:
npm start running with status: connected to development database
webpack --w running with no errors
mongod ...
0
votes
0answers
15 views
Send image using JSON in node.js (express) and an android client
I'm trying to send an image to an android client using node.js, but sending first the URL by a JSON Object which is created by the server. When it tries to set the image, it doesn't work and I don't ...
-1
votes
0answers
17 views
Express server res.json(“”) take a lot of time
I have nodejs app, I using typescript and Express server and express-session.
I have also routing function that get request from the client and response.
private async changeVis(req: express.Request,...
0
votes
2answers
41 views
Can someone help me with this syntax?
This maybe silly but I'm unfamiliar with the syntax here:
var stdin = '';
process.stdin.on('data', function (chunk) {
stdin += chunk;
}).on('end', function() {
var lines = stdin.split('\n');
...
0
votes
1answer
13 views
2 processes on same port?
I am running a node app inside a docker container.
Here is the dockerfile
FROM maven:3.3.3-jdk-8
#install node
RUN apt-get update
RUN apt-get -qq update
RUN apt-get install -y nodejs npm
# TODO ...
0
votes
0answers
9 views
Get payload that caused json parse error in Fetch
I have the following code for making POST Requests.
I'm not 100% sure about error handling here, but it was important for me that I get body text when request is not successful.
One issue that I ...
0
votes
0answers
7 views
access response object when using socket.io in nodejs/express app
Normally, I can change the view of my client from the server using a GET/POST method in my server like this:
app.get('/hello', function(req, res){
res.render('helloView', {})
});
Where helloView ...
1
vote
0answers
11 views
Kubernetes - Ingress / Service / LB
I am new to K8s and this is my first time trying to get to grips with it. I am trying to set up a basic Nodejs Express API using this deployment.yml:
apiVersion: extensions/v1beta1
kind: Deployment
...
0
votes
0answers
5 views
Using Java ProcessBuilder to call node module installed globally
I have a node module installed globally: rollup but could be any other module. If I open the command prompt(win 10) and type rollup -v it returns the module version. I'm trying to achieve this using ...
0
votes
0answers
12 views
Gulp - publish vendors to folder
For all JS code I have I minify and uglify before build my project to production.
var config =
{
dest: 'www',
vendor:
[
'./node_modules/jquery/dist/jquery.js',
'./...
0
votes
4answers
28 views
Create an object and its instance inside a module, JS, NODE
I am new to Node and JS, trying to implement a module. Inside my module I want to have an object, that I can initialize instances of it in other methods of my module (specifically in my case its a ...
0
votes
0answers
7 views
converting jade to pug
I am trying to update my jade file to pug and having slight issue. I read the documentation for updating jade to pug and was able to convert my project file to pug but I am having isses with ...
0
votes
1answer
25 views
Node.js Cluster doesn't improve no. of transactions per second as claimed by some blogs
I tried node clusters without any performance improvement. May be I might be measuring it wrongly.
Using Node.js 7.4.0
server.js
const http = require('http');
const server = http.createServer((req,...
-1
votes
0answers
39 views
How to manage time consuming function nodejs [on hold]
I have an export function that takes 3-4 minutes to execute. This function queries the database and create a csv file that will be sent to the user.
The problem is that after 1.5 minutes i got a ...
-1
votes
1answer
10 views
Tutorials to implement MEAN stack in eclipse
Most of the mean stack tutorials use visual studio as IDE. Are there any good tutorials to implement MEAN stack using eclipse?
0
votes
0answers
19 views
What's the best development workflow for building an NPM package?
I am currently trying to package a javascript library. So far I have the package set up as follows:
npm build puts everything in a build directory
main attribute in package.json points to the ...
0
votes
2answers
21 views
Can you import node's path module using import path from 'path'
I prefer using the import x from 'y' syntax, but all I've seen online is const path = require('path').
Is there a way to import the path module using this syntax?
0
votes
1answer
12 views
Gulpfile.js : How to fix “TypeError: ”listener“ argument must be a function”?
I'm starting to set up my development environment and I have some trouble when I'm running gulp on my terminal.
I don't know where this error comes from.
Here is the code from my Gulpfile.js :
var ...
0
votes
0answers
20 views
how to push data array in nodejs
i have Job history schema i want to push other data in History array..how do this..because its update my old Job history i want new one array add in req.body.history.
var JobChangeHistorySchema ...
0
votes
0answers
25 views
Docker Image layers and ENTRYPOINT sequence
I have the following dockerfile
FROM maven:3.3.3-jdk-8
#install node
RUN apt-get update
RUN apt-get -qq update
RUN apt-get install -y nodejs npm
# TODO could uninstall some build dependencies
RUN ...
0
votes
0answers
15 views
Is there a simple way to send data to USB via NodeJS?
Is there any way to send data to USB port like echo "hello world!" > /dev/usb/lp1?
Edit
I've been using label printers from different brands by only issuing some simple EPL commands:
sR
q455
...
0
votes
0answers
6 views
How to verify FCM registration token on server?
I got my Firebase Cloud Messaging registration token for web push.
And I sent this to my server to save in database for later push.
But how can I verify this token is valid or fake?
I have tried this ...
-3
votes
0answers
15 views
Success to request but wrong html content with Nodejs
I am a code beginner. Please forgive me if question is silly. My project is to crawl the webpage www.bursamalaysia.com/market and get its html. However it do not respond with the correct html in the ...
0
votes
1answer
11 views
Express API JSON and XML POST request
I have a express API which allows json post requests. However, in my scenario, one of my API's needs to accept a XML post body, rather than a JSON one.
So my express app is set fine using:
// Init ...
0
votes
0answers
11 views
Grunt ! Counting console logged runtime msg (error/warning) using grunt for implementing filterGate
I am trying to create a filterGate for automating the project task i.e. pushing code to server/vcs. I have to maintain code quality before pushing code to server/vcs by using js-linting and css-...
1
vote
2answers
17 views
Whats the proper way to use mongoose population?
I have two schemas setup:
var ClientSchema = new Schema({
name: String
});
module.exports = mongoose.model('Client', ClientSchema);
And
var PlaceSchema = new Schema({
client: {type: mongoose....
0
votes
0answers
30 views
How does node.js initialise?
When looking at my error stack traces I often find this line as the first call of the process:
process._tickCallback (internal/process/next_tick.js:103:7)
This made me wonder, is this the first thing ...
0
votes
0answers
6 views
Artifactory npm mirror does not serve package, which got removed from global registry
In our company we use Artifactory to cache npm artifacts from the global registry at https://registry.npmjs.org/ . The intention is that our builds do not break if the global registry is down or ...
1
vote
1answer
25 views
how to remove {} empty field in array .. nodejs
i am using below code...but if Status is Empty iss show below result in database...i want to remove if Status is Empty ..
1 Address {}, Status {} save in database.
function CheckStatus(oldJob, ...
0
votes
0answers
8 views
Cannot Package Visual…'PBIVIZ Package' Errors Out
I've been developing a Power BI visual and it works fine using pbiviz start and the Power BI site's developer visual. So I'm ready to package it. I tried pbiviz package, but get these errors:
C:\...
0
votes
0answers
8 views
Can't make serverside axios api call behind a firewall
I'm looking into axios to use for some node.js http calls to APIs while inside a corp firewall - and i'm falling down at the first hurdle.
I found an example that uses axios to do a server http call ...
0
votes
1answer
13 views
Express js - async pending
i'm trying return data to view from multiple selects and i'm using the async.parallel but in console show me Promise {<pending>} .
I require the var async = require('async');
This is the first ...
1
vote
2answers
15 views
Strange date behavior with mongoose
I have a document in my database that gets displayed like this when inspected with MongoDB Compass:
Now I have experimented a bit with it on the command line:
I understand that getMonth returns one ...
0
votes
0answers
4 views
Executable from node_modules/.bin eclipsing executable from /usr/local/bin
I want to execute a script with npm, something like:
//start_mongo.js
require('child_process').spawn('mongod', []);
and then npm run start_mongo.js
My problem is that npm adds node_modules/.bin ...