Trending questions in Node-js

0 votes
1 answer

How to return data from Axios API?

Hello @kartik, The issue is that the original axiosTest() function ...READ MORE

Oct 13, 2020 in Node-js by Niroj
• 82,540 points
3,072 views
0 votes
0 answers

I got an error message while creating database in Expressjs

https://www.youtube.com/watch?v=JnvKXcSI7yk I got an error at 1:08:22 Code for ...READ MORE

Dec 17, 2020 in Node-js by nishant kumar
• 120 points
38 views
0 votes
1 answer

How to Inject nestjs service from another module?

Hii, You have to export the ItemsService in the module that provides ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
451 views
0 votes
1 answer

How to check if a collection exists in Mongodb native nodejs driver?

Hello @kartik, The collectionNames method of the native driver's Db object accepts ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
422 views
0 votes
1 answer

How to read binary files byte by byte in Node.js?

Hello, Here is an example of fs.read()-ing the first ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
419 views
0 votes
1 answer

Error:node.js /socket.io/socket.io.js not found

Hello @kartik, Copying socket.io.js to a public folder (something as resources/js/socket.io.js) ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
389 views
0 votes
1 answer

How can I format a date coming from MongoDB?

Hello @kartik, JavaScript has built-in support for dates. ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
217 views
0 votes
1 answer

How to send JavaScript Object with Socket.io from server to client?

Hello @kartik, You actually need to emit an ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
208 views
0 votes
1 answer

How to create package.json from package-lock.json?

Hello @kartik, Install the latest npm with npm install ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
170 views
0 votes
1 answer

How to find the version of an installed node.js/npm package?

Hello, npm view <package> version - returns the latest ...READ MORE

Nov 24, 2020 in Node-js by Niroj
• 82,540 points
386 views
0 votes
1 answer

How to hide password in the nodejs console?

Hello @kartik, To hide your password input, you ...READ MORE

Nov 30, 2020 in Node-js by Niroj
• 82,540 points
81 views
0 votes
1 answer

How to disconnect from tcp socket in NodeJs?

Hello, Try this out: net.createConnection() returns a Socket object. client.destroy() is what ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
79 views
0 votes
1 answer

How do I perform an id array query in Mongoose?

Hello @kartik, Here is a mongoosey way to ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
58 views
0 votes
1 answer

How to automatic run gulp tasks via npm?

Hello @kartik, Here is the code: var ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
53 views
0 votes
1 answer

How to Start another node application using node.js?

Hello @kartik, Use child_process.fork(). It is similar to spawn(), but ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
42 views
0 votes
1 answer

How to end an express.js / node POST response?

Hello @kartik, You can use res.end and pass in a ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
34 views
0 votes
1 answer

How to use the middleware to check the authorization before entering each route in express?

Hello @kartik, As long as app.use(authChecker); is before app.use(app.router); it will get ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
33 views
0 votes
1 answer

How to get union of several immutable.js Lists?

Hello @kartik, Merge will update the index with ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
28 views
0 votes
1 answer

How do I parse a data URL in Node?

Hello @kartik, Put the data into a Buffer ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
25 views
0 votes
1 answer

How does a node.js process know when to stop?

Hello, node keeps track of all outstanding work ...READ MORE

Nov 29, 2020 in Node-js by Niroj
• 82,540 points
21 views
0 votes
1 answer

Error:FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Hello @kartik, You can launch NPM using : node ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
109 views
0 votes
1 answer

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Niroj\package.json'

Hello @kartik, If you already have package-lock.json file just delete ...READ MORE

Oct 13, 2020 in Node-js by Niroj
• 82,540 points
2,047 views
0 votes
1 answer

How to update a value in a json file and save it through node.js?

Hello @kartik, It's particularly useful if you're concerned ...READ MORE

Oct 11, 2020 in Node-js by Niroj
• 82,540 points
2,095 views
0 votes
1 answer

How to catch exception in node during JSON.parse?

Hello, JSON.parse runs synchronous and does not know anything ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
81 views
0 votes
1 answer

How do I test a single file using Jest?

Hii, All you have to do is chant ...READ MORE

Nov 26, 2020 in Node-js by Niroj
• 82,540 points
111 views
0 votes
1 answer

How to break _.forEach in lodash?

Hello @kartik, To finish lodash#forEach method use return false; statement: _.forEach(oIncludedFileMap, function(aIncludedFiles, sKey) ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
57 views
0 votes
1 answer

Error:Failed to parse json-This is not a bug in npm.

Hello @kartik, Try this: npm cache clean Hope it works!! Thank ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
59 views
0 votes
1 answer

How do I define methods in a Mongoose model?

Hello @kartik, You didn't specify whether you were ...READ MORE

Nov 27, 2020 in Node-js by Niroj
• 82,540 points
26 views
0 votes
1 answer

How node.js require all files in a folder?

Hello @kartik, When require is given the path ...READ MORE

Nov 26, 2020 in Node-js by Niroj
• 82,540 points
49 views
0 votes
1 answer

How to determine a user's IP address in node?

Hello @kartik, In your request object there is a property ...READ MORE

Nov 26, 2020 in Node-js by Niroj
• 82,540 points
26 views
0 votes
1 answer

How to set Environment Variables for Node to retrieve?

Hello, Environment variables (in this case) are being ...READ MORE

Nov 26, 2020 in Node-js by Niroj
• 82,540 points
23 views
0 votes
1 answer

How to run Gulp tasks sequentially one after the other?

Hello @kartik, By default, gulp runs tasks simultaneously, ...READ MORE

Nov 26, 2020 in Node-js by Niroj
• 82,540 points
17 views
0 votes
1 answer

How to download a file with Node.js without using third-party libraries?

Hii, You can create an HTTP GET request and pipe ...READ MORE

Nov 24, 2020 in Node-js by Niroj
• 82,540 points
56 views
0 votes
1 answer

How to update each dependency in package.json to the latest version?

Hello @kartik, npm-check-updates is a utility that automatically adjusts ...READ MORE

Nov 24, 2020 in Node-js by Niroj
• 82,540 points
38 views
0 votes
1 answer

How to change to an older version of Node.js?

Hello, Install specific version of node sudo npm cache ...READ MORE

Nov 24, 2020 in Node-js by Niroj
• 82,540 points
35 views
0 votes
1 answer

How to upgrad Node.js to latest version?

Hello, The module n makes version-management easy: sudo npm install n ...READ MORE

Nov 24, 2020 in Node-js by Niroj
• 82,540 points
21 views
0 votes
2 answers

Error:'TypeError: is not a function' in Node.js

You are exporting module.exports.redir = redir; That means that ...READ MORE

Oct 21, 2020 in Node-js by anonymous
• 140 points
1,545 views
0 votes
1 answer

How to force tsc to ignore node_modules folder?

Hello @kartik, Quickfix is to skip the check { ...READ MORE

Oct 14, 2020 in Node-js by Niroj
• 82,540 points
1,640 views
0 votes
1 answer

How to fill an input field using Puppeteer?

Hello @kartik, Just set value of input like ...READ MORE

Oct 16, 2020 in Node-js by Niroj
• 82,540 points
1,126 views
0 votes
1 answer

How do you run a js file using npm scripts?

Hello @kartik, Try this: { "scripts" : { ...READ MORE

Oct 11, 2020 in Node-js by Niroj
• 82,540 points
1,053 views
0 votes
1 answer

How to restart a node.js server?

Hello @kartik, If it's just running (not a ...READ MORE

Oct 11, 2020 in Node-js by Niroj
• 82,540 points
1,043 views
0 votes
1 answer

Error: Cannot find module 'mongodb'

Hello @kartik, The error you are getting indicates ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,540 points
872 views
0 votes
1 answer

How to use an include with attributes with sequelize?

Hello @kartik, Something like this should work foo.findAll({ ...READ MORE

Oct 13, 2020 in Node-js by Niroj
• 82,540 points
864 views
0 votes
1 answer

How to append to New Line in Node.js

Hello @kartik, you're running this on Windows (given ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,540 points
2,228 views
0 votes
1 answer

Error:Missing file extension "ts" for "./lib/env" import/extensions

Hello @kartik, Add the following code to rules: "rules": { ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,540 points
575 views
0 votes
1 answer

How to “Ping” from a Node.js app?

Hello @kartik, You could use exec to call the system ...READ MORE

Oct 16, 2020 in Node-js by Niroj
• 82,540 points
507 views
0 votes
1 answer

Error:node' is not recognized as an internal or external command

Hello @kartik, Node is missing from the SYSTEM ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,540 points
547 views
0 votes
1 answer

Error:sudo: npm: command not found

Hello @kartik, I had the same problem; here ...READ MORE

Jul 15, 2020 in Node-js by Niroj
• 82,540 points
4,504 views
0 votes
1 answer

Error: jQuery requires a window with a document

Hello @kartik, Try this: // definition var $ = require('jquery')(require("jsdom").jsdom().parentWindow); // ...READ MORE

Oct 16, 2020 in Node-js by Niroj
• 82,540 points
461 views
0 votes
1 answer

How to get Node.JS Express to listen only on localhost?

Hello @kartik, This is a bug in hive-go that only ...READ MORE

Oct 16, 2020 in Node-js by Niroj
• 82,540 points
386 views