Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi everyone
Can anyone help me or show me the right way to approach this assignment for my class? I am new to programming and missed lots of class. I just want to know the step by step process or the things I need to learn it.

Node-Express      Site      with      Nodemailer      – Research      Assignment
Using      a      brand      new      Express      Generator      App      skeleton,      add      the      following:
(1) Build      out      a      few      ‘standard’      routes (contact,      team,      etc.)      in      the      application;      
each      of      these      routes should      in      the      end      render      out      a      full      HTML-based      page
(from      included      partial files,      see      below),      but      you      do      not      need      any      content      
other      than      placeholder      text/image      content      in      each      view.
(2)Install      the      Nodemailer module      through      npm to      make      it      available locally,      
(using      SMTP) in      your      application.      Use      the      Nodemailer      documentation      as      a      
guide      and      build      a      route      and      a      view (form) to      enable      sending      an      email      through      
a      mail      service      (NOTE:      If      you      use      Gmail      you      may      get      a      warning      email      when      
you      test      it      that      your      Google      credentials      were      used      by      an      ‘unsafe’      app,      that      is      
to      be      expected). Search      for      Nodemailer      from      the      npm      main      site,      and      you      will      
get      to      the      documentation      that      will      show      you      how      to      set      everything      up.
(3) Use partials in      ejs,      the      page      renderer      you      are currently using,      so      that      you      can      
create      and      include      ‘proper’ views      (e.g.,      header,      footer).      Then      modify      all fullpage
ejs      examples into      a      more      modular      form.
(4) Add      some      CSS      styling to      the      ejs      template      views      in      your      application, again      not      
a      fully      designed      …
I have a Nutanix / Dell 3 node environment, I have managed to change the host Ip addresses to a new subnet and I have also change the CVM ip addresses, but I am having problems finding a way to either change the Cluster IP address from the CLI or break the cluster and rebuild with new IP and name.   Can anyone help?  I am not that conversant with Linux so a simple explanation if possible to get this done.

Many thanks

I am trying to subtract time now() with data from mysql.
Over here, M_Start = "08:15:00"
Example Current = "22:02:39"
My intention is to get total seconds of the different.
While using moment function : error message : "ReferenceError: moment is not defined (line 22, col 9)"

var ST_Target;
var Shift_Target;

var M_Start = flow.get('Morning_start');
var M_Stop =flow.get('Morning_end');
var M_sec = flow.get('Morning_sec');

var M_cycle = flow.get("Cycle_Time");

var dt = new Date();
var hour = dt.getHours();
hour = ("0" + hour).slice(-2);

var minute = dt.getMinutes();
minute=("0" +minute).slice(-2);

var sec = dt.getSeconds();
sec=("0" + sec).slice(-2);

var current = hour+":" +minute+":"+sec;

var d = moment.duration(current.diff(M_Start[0]));

Open in new window

I'm trying to install PhoneGap CLI. When I run this
npm install -g phonegap@latest

Open in new window

I get this
phonegap CLI install error
I have reinstalled Node.js
The versions I have are
Node 10.11.0
npm 5.4.2 (installed when installing Node, I believe)

Can anybody help please?
2016 clustered environment . Nodes A crashed after a Ms path so it was rebuilt from an image of node B. I did make sure my ip's are correct.  Now im not able to Ping the private Network. Able to Ping one way only. Can ping from no B to node a. Cannot ping from node a two node be. This is after a crash where I had to rebuild node a from an image of node be. I have reset all settings but this one still has me confused any ideas.
Pings x.x.0.2 on nobe b to node a x.x.0.3 works.
Not working
Ping x.x.0.3  to x.x.0.2
Even isolated ping by typing.
Ping X.x.0.3 -S x.x.0.2
Still not pinging private network (heartbeat)

In node red, while i insert the - timestamp datatype its work perfectly. while try to select data with the time stamp, its display different time.

Data insert in mariadb ----> 2018-09-19 23:47:26

While select data
if (Device > 0)
    msg.topic ="Select DeviceId, Line, outPIN, count,Time FROM mytab LIMIT 1";

return msg;

Open in new window

While try pull data out of mariadb the data timestamp show --> 2018-09-19 00:20:00
Hi I am selecting data from mysql database in node red: -

my database value are as follows:-
Code in node red as follows: -
 msg.topic ="Select DeviceId, Line, outPIN, count,Time FROM mytab LIMIT 1"

Open in new window

In debug node i do get the time in different format and unable to store in different location of database.

9/17/2018, 4:59:29 PMnode: 4f250b1.97196f4
INSERT INTO mytable1 (DeviceId,Line,outPIN,count,Time) VALUES (?,?,?,?,?) : msg.payload : array[5]
[ 2, 1, "7", 1, "2018-09-16T13:28:24.000Z" ]
9/17/2018, 4:59:29 PMnode: d00874f1.76f388
msg : error
"Error: ER_TRUNCATED_WRONG_VALUE: Incorrect datetime value: '2018-09-16T13:28:24.000Z' for column 'Time' at row 1"

Open in new window

How i can format the time back to normal 'yyyy-mm-dd hh:mm:ss'

I wanted to develop print solution for my web app : Web app to Desktop print appl using microsoft stack.

when someone press print button on web app, web app may send something like push notification as COMMAND to desktop application (User specific) and upon receipt of command Desktop print app can print the documents. If case of failure Desktop Print Application can send back information to web app about print failure.

To send push notification from web app to Desktop app,
can i use SignalR for sending user specific push notification ?

Please suggest :

1.Am i going in right direction.Whether the industry standards use same process like Google Print or PrintNode.

If not what technology/Process i can use for such application.
Initialy developing for one customer but need for multiple users.

Error message:  Node 'server' failed to form a cluster. This was because the witness was not accessible. Please ensure that the witness resource is online and available.

The virtual server is up and running and doesn't seem to have any problems but it will not become a part of the cluster.   The server node shows as being down and both the ISCSI connection and Public connections are down
Windows Cluster 2016 error , Node 1 unavailable after a restart (after installing Patch 1 for SQL cluster.) Pinged the IP and the IP is available , able to RDP to the server. Also all disk are up and running only issue is with NODE1 network its showing unavailable.
Please Advise.
Hello expert,

In UML (Unified Modeling Language) Activity Diagrams there are elements called fork
and join nodes. They are simply a black lozenge shapes  (see attached GIF) where several
parallel process merge (join) or split (fork).
This makes it necessary to have several arrows point to the fork or join node.
The node is created with a rounded rectangle.

The problem is the arrows only want to point to the rounded rectangle at the vertical and
horizontal mid points of the rounded rectangle. But the process arrows coming into the
join or fork could be a half dozen on each side.

Is there a way to make the fork or join node look like a comb on each side?
I know there's a ton of questions around date/time storage and formatting, but I'm struggling to get the right approach. My app is a Node.js app with Express using mongoose with a MongoDB backend. I'm using moment.js to format my date/times.

The schema in question looks like:

const stateSchema = new mongoose.Schema({
  changed: {
    type: Date,
    default: new Date()

Open in new window

Based on the docs, I was expecting the date to be stored in UTC by default, but instead I see this:
changed: 2018-08-15 17:26:14.499

Open in new window

I'm displaying the date/time with something like (pug):

p= `Changed: ${moment(state.changed).format('MMMM Do YYYY, h:mm:ss a')}`

Open in new window

On localhost, the app shows "August 15th 2018, 5:26:14 pm" but on the hosted Heroku app I get "August 15th 2018, 10:26:14 pm." I am expecting "August 15th 2018, 5:26:14 pm" because I'm opening the Heroku app in the same timezone, but it looks like it's giving me the server timezone.

What should I do to make sure the date/time shows up in the client's local timezone?
I have a Button within a react component that has five values tied to the "Survey" component state.  Within the button I have a property called "triggerSurveyUpdate" that when the user clicks the button it triggers the property in parent component App so that I can change conditional rendering with the App component.  Also when the user clicks the button I want to call a function "handleClick" which in turn calls a function named "surveysIn". "surveyIn" in turn then does an axios post to post  my values from the 'Survey' component to my Node back end. The problem is that if I put both "this.props.triggerSurveyUpdate" and "this.handleClick.bind(this)" within the Button tag then the first "this.props.triggerSurveyUpdate" gets called but then "this.handleClick.bind(this) does not fire.  If I put both "this.props.triggerSurveyUpdate and "this.handleClick.bind(this)" within the handleClick(e) function then the "this.props.triggerSurveyUpdate" does not fire.  How can do I get react to fire both "this.props.triggerSurveyUpdate and "surveysIn" such that I am able to post values from the "Survey" component state to my back end and then also trigger the property "this.props.triggerSurveyUpdate" so that I can do my conditional rendering in my "App" component.  Below is my code for my Survey component.

import React, { Component } from 'react';
import {Slider} from 'primereact/components/slider/Slider';
import {Button} from 'primereact/components/button/Button';
import surveysIn 

Open in new window


I have an xml wihich i am try to extract data from.  It looks like this:

declare @xmlData xml = '
'</Measurement2018></BPSD-registret>' ;

Open in new window

I can extract and save the content of each <action> node using the following code:

insert into BPSD_MeasurementActions
a.value('(activity)[1]', 'nvarchar(500)' ) as act_Activity,
a.value('(when)[1]', 'nvarchar(500)' ) as act_When,
a.value('(where)[1]', 'nvarchar(500)' ) as act_Where,
a.value('(how)[1]', 'nvarchar(500)' ) as act_How,
a.value('(whom)[1]', 'nvarchar(500)' ) as act_With,
a.value('(duration)[1]', 'nvarchar(500)' ) as act_HowLong
from @xmlData.nodes('/BPSD-registret/Measurement2018/naza_bpsd/Actions/Current/Action') Actions(a)

Open in new window

The table BPSD_MeasurementActions has an identity column called Id (Integer).  

The problem is that the node <measures> has now been added to the xml.  I need to save the values of each <measure> node.   Therefore there is a one to many relationship with the <action> node and i need to save these values in a details table.  The value of Id from BPSD_MeasurementActions will be the foreign key.

Any sugestions on how i can traverse this xml and do the appropriate insertions?
Why use AngularJS instead of NodeJs

I would like to know why you should use AngularJS instead of NodeJS seeing that NodeJS can  fetch the Data from the Database server and present it to end user browser. I have seen some AngularJs videos where they use arrays and some code to present data on the browser, I have not seen any example where the Angular connect to the Database...
I thought probably NodeJs can do the same thing Angular does, with easier code.

Reading online, I see Angular is described as Framework ,whereas NodeJs is a Library...but do they achieve the same thing ?

Thank you

After researching heavily on why the delete query was failing in MS Access FE/SQl Server BE over the net and reading other IT books, it seems like the foreign key is cantered on the issues below:
INSERT and UPDATE Specification Category
I expanded the node to show information for the Delete Rule and the Update Rule for the relationship.
Delete Rule
It says specify what happens if a user tries to delete a row with data that is involved in a foreign key relationship:
•      No Action An error message tells the user that the deletion is not allowed and the DELETE is rolled back.
•      Cascade Deletes all rows containing data involved in the foreign key relationship. Do not specify CASCADE if the table will be included in a merge publication that uses logical records.
•      Set Null Sets the value to null if all foreign key columns for the table can accept null values.
•      Set Default Sets the value to the default value defined for the column if all foreign key columns for the table have defaults defined for them.
Update Rule
It says specify what occurs if a user tries to update a row with data that is involved in a foreign key relationship:
•      No Action An error message tells the user that the update is not allowed and the UPDATE is rolled back.
•      Cascade Updates all rows that contain data involved in the foreign key relationship. Do not specify CASCADE if the table will be included in a merge publication that uses logical records.
•      Set Null Sets the value to null if all …

I need Help i am trying to add my failed Exchange Server 2010 to a DAG but when i ran the command in the image and getting the error. Please for your assistance.Adding-to-Cluster.JPG
I have the google c# api code and it works fine.But I want to get
child node : photos {height and width}.
open now
weekday text

Can you help me what I need to do with the codes below? Thank


protected void Page_Load(object sender, EventArgs e)
             WebClient wc = new WebClient();
            string jsonStr = wc.DownloadString(",-122.443&radius=10000&type=rv_park&key=AIzaSyCietasdfasdfasdfasdfxzD65Uc19X6DgrJFumdi-nCZYSHjg");
            GooglePlacesResponse gpr = (GooglePlacesResponse)JsonConvert.DeserializeObject<GooglePlacesResponse>(jsonStr);
            Response.Write(gpr.status + "<br><br>");
            foreach (results r in gpr.results)
                    ( + " "  + 
            + " " + 
                     r.geometry.location.lng + " " +
                     r.reference + " " +
                     r.vicinity  + " " +                         

        public class GooglePlacesResponse
            public string status { get; set; }
            public results[] results { get; set; }
        public class results
            public geometry geometry { get; set; }

Open in new window

i have a node that contains (america-germany) and  another node contain (america&#x02010;germany),when i check for this node are equals or not it say it is not Equal, i am using java with dom parser ,but when i put entity value(&#x02010;) in both node it say Equal,why can anyone help me
I have glassfish app on my Linux red hat 6.
I cant start my glassfish node it gives me next error :

There is a process already using the admin port 5858 -- it probably is another instance of a GlassFish server.Command start-domain failed.

But when i run comman in linux " netstat -tulnp | grep 5858 " It shows me:

tcp :::5858 LISTEN 47256/java

Port used by java app. But i cant log in to my glassfish interface.

How can i solve this issue, any expierenced specialist with glassfish maybe can help.
sir i have a list :that contain some value : after i am geeting node content value: and cheak that node content value contains list value or not:but i am getting exception because list not converted to charsequence : my code is List<String> xx = new ArrayList<String>(); xx.add("Van"); xx.add("Von"); xx.add("Le"); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document d = builder.parse(file); d.getDocumentElement().normalize(); String[] s = xx.toArray(new String[xx.size()]); NodeList ndlist = d.getElementsByTagName("personName"); for (int i = 0; i < ndlist.getLength(); i++) { Node node = ndlist.item(i); NodeList nl = node.getChildNodes(); for (int j = 0; j < nl.getLength(); j++) { Node node1 = nl.item(j); if (node1.getNodeName().equals("givenNames")) { Element element = (Element) node1; String str = element.getTextContent().toUpperCase(); if(str.contains(xx))//error list cannot convert to charsequence { //some opration } } }
I'm currently doing a small from which only contains a html5 pages .. index.html.

Currently I am adding the javascript code to the actual page between script tags.

What I want to do is to create an ES6 module and import it to to this index.html page.

But I want to do this without having to use node, angular or react in a project.

What is the easiest ay to do this with my layout?
I have xml  as clob in table request_detail where xml is stored in column detail :

<?xml version="1.0" encoding="UTF-8"?><ns2:OrderServiceRequest xmlns:ns2="ca/abc/com/integration" xmlns="ca/abc/oms/autotype/omscommonrequest" xmlns:S="" xmlns:cil="" xmlns:io="" xmlns:io10="ca/abc/com/integration" xmlns:io11="" xmlns:io12="ca/abc/oms/autotype/productavailability" xmlns:io13="ca/abc/oms/autotype/cancelorder" xmlns:io14="ca/abc/oms/autotype/submitrequest" xmlns:io15="ca/abc/oms/autotype/omscommonresponse" xmlns:io16="ca/abc/oms/autotype/billingRetrieve" xmlns:io17="ca/abc/oms/autotype/locationmanagement" xmlns:io18="" xmlns:io19="ca/abc/oms/autotype/productconfiguration" xmlns:io2="" xmlns:io20="ca/abc/oms/autotype/omscommonrequest" xmlns:io21="wsdl." xmlns:io22="ca/abc/oms/orderretrieval" xmlns:io3="" xmlns:io4="ca/abc/oms/autotype/omscommon" xmlns:io5="ca/abc/oms/autotype/qualification" xmlns:io6="ca/abc/oms/customerprofile" xmlns:io7="" xmlns:io8="http://CILNBOMFCustomerOrderMod" xmlns:io9="" xmlns:ns0="wsdl." xmlns:ns3="ca/abc/oms/autotype/omscommon" 

Open in new window

I'm having trouble with some odd routing behavior when I build my angular app in preparation for deployment. When I run the app locally using 'ng serve', navigation works just fine and everything seems to be ready for deployment. However after I run 'ng build --prod' and the dist folder is generated, if I launch the index.html navigation is broken in the following ways:

If I refresh the page, it fails to load (resulting in 404)

If I attempt to navigate to a page that uses a different component than the landing page it fails to load (404)

I have tried these suggested solutions:
Change the base href in index.html to <base href = "./">
Change AppModule providers to include {provide: LocationStrategy, useClass: HashLocationStrategy}
Change App.Routing to include RouterModule.forRoot(routes, {useHash: true})
I've been though this tutorial to get electron to work on an angular 5 project.

As you can see it also installs ngx-electron module.

This has the following properties:

desktopCapturer: Electron.DesktopCapturer - Electron's desktop capturing API
ipcRenderer: Electron.IpcRenderer - Electron IpcRenderer
remote: Electron.Remote - Electron Remote capabilities
webFrame: Electron.WebFrame - Electron WebFrame
clipboard: Electron.Clipboard - Clipboard API
crashReporter: Electron.CrashReporter - Electron's CrashReporter
process: NodeJS.Process - Electron's Process Object
screen: Electron.Screen - Electron's Screen API
shell: Electron.Shell - Electron's Shell API
nativeImage: Electron.NativeImage - Electron's NativeImage API
isElectronApp: boolean - Indicates if app is being executed inside of electron or not

But I don't see how you can use FS ?

How can I use FS in this project with Angular 5 / Electron?






Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Top Experts In