Most answered questions in Node-js

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,880 points
4,334 views
0 votes
1 answer

How to get “should.be.false” syntax pass jslint?

Hello @kartik, You can add /*jshint expr: true*/ to the ...READ MORE

Oct 16, 2020 in Node-js by Niroj
• 82,880 points
552 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,880 points
23,152 views
0 votes
1 answer

How to run shell script file using nodejs?

Hello @kartik, You could use "child process" module ...READ MORE

Oct 16, 2020 in Node-js by Niroj
• 82,880 points
8,517 views
0 votes
1 answer

How to split and modify a string in NodeJS?

Hello @kartik, Use split and map function: var str = "123, 124, 234,252"; var ...READ MORE

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

How can I get the browser language in node.js?

Hello @kartik, You can use req.headers["accept-language"] to get the language/locale ...READ MORE

Oct 16, 2020 in Node-js by Niroj
• 82,880 points
3,764 views
0 votes
1 answer

How to set the content-type of request header when using Fetch APi?

Hello @kartik, You need to create a fetch ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,880 points
7,329 views
0 votes
1 answer

Error:TypeError: Object.values is not a function.

Hello @kartik, Object.values is a new feature . It is ...READ MORE

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

How to get the npm global path prefix?

Hello @kartik, Try this: npm config get prefix will return ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,880 points
4,800 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,880 points
12,339 views
0 votes
1 answer

How to provide a mysql database connection in single file in nodejs?

Hello @kartik, You could create a db wrapper ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,880 points
8,509 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,880 points
7,623 views
0 votes
1 answer

How to create a pair private/public keys using Node.js crypto?

Hello @kartik, nodejs v10.12 now supports this natively ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,880 points
4,512 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,880 points
5,980 views
0 votes
1 answer

How can i update multiple documents in mongoose?

Hello @kartik, Use: Device.updateMany({}, { cid: '' }); Hope it ...READ MORE

Oct 15, 2020 in Node-js by Niroj
• 82,880 points
3,551 views
0 votes
1 answer

How to deploy node app that uses grunt to heroku?

Hello @kartik, npm has a support for a postinstall step ...READ MORE

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

How to rendering HTML in variable using Jade?

Hello @kartik, Code buffered by = is escaped ...READ MORE

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

How to get hash of most recent git commit in Node?

Hello @kartik, Try this: revision = require('child_process') .execSync('git ...READ MORE

Oct 14, 2020 in Node-js by Niroj
• 82,880 points
2,264 views
0 votes
1 answer

How to get path from the request in nodejs?

Hello @kartik, Try this out: var http = require('http'); var ...READ MORE

Oct 14, 2020 in Node-js by Niroj
• 82,880 points
4,105 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,880 points
27,025 views
0 votes
1 answer

Error:'bower' is not recognized as an internal or external command, operable program or batch file

Hello @kartik, Fixed it by adding the 'npm' ...READ MORE

Oct 14, 2020 in Node-js by Niroj
• 82,880 points
4,906 views
0 votes
1 answer

How to run node.js app forever when console is closed?

Hello @kartik, You may also want to consider ...READ MORE

Oct 14, 2020 in Node-js by Niroj
• 82,880 points
2,161 views
0 votes
1 answer

Error: listen EACCES 0.0.0.0:80 OSx Node.js

Hello @kartik, Give root access to node and ...READ MORE

Oct 14, 2020 in Node-js by Niroj
• 82,880 points
5,194 views
0 votes
1 answer

How to save a stream into multiple destinations with Gulp.js?

Hello @kartik, Currently you have to use two ...READ MORE

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

Uncaught Error: Module did not self-register.", source: /home/niroj/dev/jukebox/node_modules/vlc/node_modules/ffi/node_modules/bindings/bindings.js (84)

Hello @kartik, If you've upgraded node then npm rebuild might ...READ MORE

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

How to get the available tasks list in gulp?

Hello @kartik,  I got it use the gulp --tasks in ...READ MORE

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

How to implement a writable stream?

Hello @kartik, to create a writeable stream is ...READ MORE

Oct 13, 2020 in Node-js by Niroj
• 82,880 points
1,040 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,880 points
23,815 views
0 votes
1 answer

How to just run post-install?

Hello @kartik, You can run individual script entries ...READ MORE

Oct 13, 2020 in Node-js by Niroj
• 82,880 points
1,442 views
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,880 points
44,076 views
0 votes
1 answer

TypeError: Cannot read property 'confvar' of undefined

Hello @kartik, You need module.exports: An object which is shared ...READ MORE

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

How to automate npm and bower install with grunt?

Hello @kartik, To install client side components during npm ...READ MORE

Oct 13, 2020 in Node-js by Niroj
• 82,880 points
547 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,880 points
14,212 views
0 votes
1 answer

How to run app.js in nodejs?

Hello @kartik, Assuming I have node and npm properly installed on the ...READ MORE

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

How to get data out of a Node.js http get request?

Hello @kartik, Your logs return undefined : you log before ...READ MORE

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
6,537 views
0 votes
1 answer

How to use MongoDB with promises in Node.js?

Hello @kartik, Try this: var MongoClient = require('mongodb').MongoClient var url ...READ MORE

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
1,015 views
0 votes
1 answer

How to restart a node.js server?

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

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
21,869 views
0 votes
1 answer

How do you run a js file using npm scripts?

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

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
10,569 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 12, 2020 in Node-js by Niroj
• 82,880 points
25,394 views
+1 vote
1 answer

How to make external HTTP requests with Node.js ?

Hello @kartik, Use this: var http = require('http'); var options ...READ MORE

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
1,485 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 12, 2020 in Node-js by Niroj
• 82,880 points
18,653 views
0 votes
1 answer

Error:/usr/bin/env: node: No such file or directory

Hello @kartik, You have to manually link to ...READ MORE

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
6,675 views
0 votes
1 answer

How to console.log to stdout on gulp events?

Hello @kartik, Use this: var gulp = require("gulp"); var util ...READ MORE

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
5,723 views
0 votes
1 answer

How to Pass route control with optional parameter after root in express?

Hello @kartik, That would work depending on what ...READ MORE

Oct 12, 2020 in Node-js by Niroj
• 82,880 points
13,384 views
0 votes
1 answer

How npm start runs a server on port 8000?

Hello @kartik, If you will look at package.json file. you will ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,880 points
9,627 views
0 votes
1 answer

How to create an Excel File with Nodejs?

Hello @kartik, Just create a file with Tabs ...READ MORE

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

Error: Cannot find module 'ejs'

Hello @kartik, Go up one level (above app.js) ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,880 points
9,814 views
0 votes
1 answer

Error:Cannot find module 'xmlhttprequest'

Hello @kartik, XMLHttpRequest is a built-in object in web ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,880 points
6,509 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,880 points
18,183 views
0 votes
1 answer

How to create .pem files for https web server?

Hello @kartik, The two files you need are ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,880 points
3,075 views