Questions tagged as 'node.js'

1
answer

I can not create project using Express Node.js

I'm following a Node.js tutorial and I'm learning about frameworks, but when I try to install express by cmd of error, I'm trying to do it like this: express aplicativo1 And the error that appears in cmd is this:    'expres...
asked by 02.07.2015 / 16:48
3
answers

ForEach wait for the select result to proceed

I have a forEach that goes through a list of codes and inside it I have a select that queries the records of the database. After forEach , the data is sent from my server to my client, but forEach does not wait for the result...
asked by 24.11.2017 / 11:53
2
answers

Use Node.js and PHP on the same server (Amazon EC2)

My site is made "totally" in PHP and I used Node.js for the real-time chat part. I'm using the AWS services and I had a big question: Can I install Node.js in the same instance of PHP (apache) or should I create an instance for Node separatel...
asked by 10.11.2016 / 17:28
2
answers

In NodeJS, global variable in my app.js file is undefined in another file

I'm in a project using NodeJS, and its Express framework. In the main file app.js I call a function to read a file, and assign it to a global variable: global.google_sheet_credentials = readFileCredentials("spread_sheet.txt"); The func...
asked by 27.04.2016 / 13:47
1
answer

How to use Try / Catch in reading files

I have a method called readFileCredentials that has the purpose of opening a file and returning the data that was inside that file, it follows the code of this method: readFileCredentials = function(file, cb){ var _path = 'data-sour...
asked by 05.05.2016 / 15:20
1
answer

How to read this JSON correctly? MSSQL and Node

{ "recordsets": [ [ { "IdUsuario": 5152490, "strNome": "Roberto ", "IdPapel": 1 }, { "IdUsuario": 5152490, "strNome": "Roberto ", "IdPapel": 3000001 } ] ] I'm...
asked by 30.11.2018 / 18:03
2
answers

How to create a property in an existing object of an http request?

I'm trying to exhaustively put a property on an object that comes from a request (JSON), but I'm not getting it, it's like it just does not get it, but when I do a console.log, there it is, but it's not returning in the reply I send to the postm...
asked by 16.05.2018 / 00:22
1
answer

Error trying to run ionic serve windows

When I try to start my project Ionic is giving the following error: 0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cl...
asked by 13.02.2017 / 21:00
1
answer

Monitor file and or directory

I have this method that reads the file const fs = require('fs'); const path = require('path'); let arquivo = path.join(__dirname, 'arquivo.txt'); fs.readFile(arquivo, { encoding: 'utf-8' }, function(err, data) { if (!err) { // Re...
asked by 02.11.2017 / 12:27
1
answer

How to find the ExpressJS version?

How do I find out the installed version of ExpressJs?     
asked by 16.11.2015 / 23:04