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,760 points
9,890 views
0 votes
1 answer

How to clean node_modules folder of packages that are not in package.json?

Hello @kartik, You could remove your node_modules/ folder ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,760 points
12,212 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,760 points
7,536 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,760 points
6,563 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,760 points
4,379 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,760 points
6,000 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,760 points
3,480 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,760 points
6,840 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,760 points
5,124 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,760 points
2,833 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,760 points
2,674 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,760 points
2,658 views
0 votes
1 answer

How can I set NODE_ENV=production on Windows?

Hello @kartik, It would be ideal if you ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,760 points
8,445 views
0 votes
1 answer

How do I redirect in expressjs while passing some context?

Hello @kartik, The easiest way I have found ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,760 points
8,325 views
0 votes
1 answer

Error:NPM global install “cannot find module”

Hello @kartik, I got this error Error: Cannot find ...READ MORE

Jul 16, 2020 in Node-js by Niroj
• 82,760 points
7,951 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
3,634 views
0 votes
1 answer

How to clear https proxy setting of NPM?

Hello @kartik, By running npm config rm proxy you remove ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,760 points
7,345 views
0 votes
1 answer

How to set environment variables from within package.json?

Hello @kartik, Set the environment variable in the ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,760 points
7,371 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,760 points
1,141 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,760 points
7,027 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,760 points
3,189 views
0 votes
1 answer

How to extract request http headers from a request using NodeJS connect?

Hello @kartik, To see a list of HTTP ...READ MORE

Jul 15, 2020 in Node-js by Niroj
• 82,760 points
6,952 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,760 points
902 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
136 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,760 points
835 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,760 points
638 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,760 points
2,715 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,760 points
581 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,760 points
656 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,760 points
2,650 views
+1 vote
1 answer

How to restore/reset npm configuration to default values?

Hello @kartik, To reset user defaults Run this in ...READ MORE

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

How do I send command line arguments to npm script?

Hello @kartik, The syntax is as follows: npm run ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,760 points
6,719 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,760 points
495 views
0 votes
1 answer

How to get the _id of inserted document in Mongo database in NodeJS?

Hello @kartik, A shorter way than using second ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,760 points
4,067 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,760 points
526 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,760 points
415 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,760 points
2,325 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,760 points
582 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,760 points
467 views
0 votes
1 answer

Error:npm-cli.js not found when running npm

Hello @kartik, You need to run this in ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,760 points
3,911 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,760 points
277 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,760 points
364 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,760 points
266 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,760 points
146 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,760 points
242 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,760 points
120 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,760 points
71 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,760 points
60 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,760 points
239 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,760 points
87 views