Most answered questions in Node-js

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,880 points
36,063 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,880 points
23,324 views
0 votes
1 answer

How do I determine the current operating system with Node.js

Hello @kartik, With Node.js v6 (and above) there ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,880 points
3,454 views
0 votes
1 answer

How nodejs get file name from absolute path?

Hello @kartik, Use the basename method of the path module: path.basename('/foo/bar/baz/asdf/quux.html') // returns 'quux.html' If you ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,880 points
3,075 views
0 votes
1 answer

How can I get npm start at a different directory?

Hello @kartik, Try using: npm start --prefix path/to/your/app & inside ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,880 points
10,459 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,880 points
23,187 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,880 points
29,565 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,880 points
29,290 views
0 votes
1 answer

How to create an HTTPS server in Node.js?

Hello @kartik, The minimal setup for an HTTPS ...READ MORE

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

How TO install a local module using npm?

Hello @kartik, In the local module directory: $ cd ...READ MORE

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

How to write a test which expects an Error to be thrown in Jasmine?

Hello @kartik, Try using an anonymous function instead: expect( ...READ MORE

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

How to use executables from a package installed locally in node_modules?

Hello @kartik, Use the npm bin command to get the ...READ MORE

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

Node.js version on the command line?

Hello @kartik, The command line for that is: node ...READ MORE

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

How can I update npm on Windows?

Hello @kartik, To update NPM, this worked for ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,880 points
6,192 views
0 votes
1 answer

ReferenceError: primordials is not defined in node

Hello @kartik, Use following commands and install node v11.15.0: npm ...READ MORE

Jul 12, 2020 in Node-js by Niroj
• 82,880 points
9,980 views
0 votes
1 answer

How do you reinstall an app's dependencies using npm?

Hello @kartik, The easiest way is  to delete node_modules folder ...READ MORE

Jul 12, 2020 in Node-js by Niroj
• 82,880 points
2,321 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

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

Error:npm WARN unmet dependency in nodejs

Hii @kartik, Following are the possible solution : Manually ...READ MORE

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

How can I pretty-print JSON using node.js?

Hello @kartik, JSON.stringify's third parameter defines white-space insertion ...READ MORE

Jul 12, 2020 in Node-js by Niroj
• 82,880 points
4,774 views
0 votes
1 answer

How to Install a local module using npm?

Hello @kartik, This is what worked for me: npm ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
8,875 views
0 votes
1 answer

How to auto-reload files in Node.js?

Hello @kartik, A good, up to date alternative ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
1,879 views
0 votes
1 answer

Error: listen EADDRINUSE while using nodejs?

Hello @kartik, EADDRINUSE means that the port number which listen() tries ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
6,084 views
0 votes
1 answer

How to print a stack trace in Node.js?

Hello @kartik, To print stacktrace of Error in console in ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
644 views
0 votes
1 answer

How to list npm user-installed packages?

Hello @kartik, This works pretty well too:  npm list ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
3,947 views
0 votes
1 answer

How to process POST data in Node.js?

Hello @kartik, You can use the querystring module: var qs = ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
2,352 views
0 votes
1 answer

How to create a directory if it doesn't exist using Node.js?

Hello @kartik, Try: var fs = require('fs'); var dir = ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
5,749 views
0 votes
1 answer

How do I “include” functions from my other files in nodejs?

Hello @kartik, You require any js file,so you just ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
3,036 views
0 votes
1 answer

How do I update Node.js?

Hello @kartik, First update npm, npm install -g npm stable Then ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
576 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,880 points
10,703 views
0 votes
1 answer

How to install a previous exact version of a NPM package?

Hello @kartik, If you have to install an ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
2,587 views
0 votes
1 answer

How do I get the path to the current script with Node.js?

Hello @kartik, you can do this: fs.readFile(path.resolve(__dirname, 'settings.json'), 'UTF-8', ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
2,471 views
–1 vote
1 answer

How to uninstall npm modules in node js?

Hello @kartik, The command is simply: npm uninstall ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
2,838 views
0 votes
1 answer

How to get GET (query string) variables in Express.js on Node.js?

Hello @kartik, Since you've mentioned Express.js in your ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
3,019 views
0 votes
1 answer

Error:npm throws error without sudo

Hello @kartik, This looks like a permissions issue ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
896 views
0 votes
1 answer

How to write files in Node.js?

Hello @kartik, Currently there are three ways to ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
710 views
0 votes
1 answer

How to read environment variables in Node.js?

Hello @kartik, Yes,you can read environment variables in Node.js ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
1,391 views
+2 votes
1 answer

How do I debug Node.js applications?

Hello @kartik, Use node-inspector  from any browser supporting WebSocket. Breakpoints, ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
781 views
0 votes
0 answers

Writing a typescript declaration file for an external js nodejs package, without type info

I'm writing a node js typescript library ...READ MORE

Aug 19, 2022 in Node-js by Neha
• 9,060 points
3,021 views
0 votes
0 answers

Instagram API not working via Nodejs

Here is my http POST code, running ...READ MORE

Aug 19, 2022 in Node-js by Neha
• 9,060 points
425 views
0 votes
0 answers

NodeJS, express - routing

I´ve setup a little NodeJS API with ...READ MORE

Aug 19, 2022 in Node-js by Neha
• 9,060 points
373 views
0 votes
0 answers

How can i download high quality you tube video using ytdl-core package in nodejs?

my code snippet as below: const express = ...READ MORE

Aug 19, 2022 in Node-js by Neha
• 9,060 points
1,380 views
0 votes
0 answers

How to train a model in nodejs (tensorflow.js)?

I'd like to create an image classifier, ...READ MORE

Aug 19, 2022 in Node-js by Neha
• 9,060 points
604 views
0 votes
0 answers

Use Custom DNS resolver for any request in NodeJS

I'm looking to find a way to ...READ MORE

Aug 19, 2022 in Node-js by Neha
• 9,060 points
1,287 views
0 votes
0 answers
0 votes
0 answers

How can i make my REST API Faster with nodejs and express?

Summarize the problem My problem: I have built ...READ MORE

Aug 19, 2022 in Node-js by Neha
• 9,060 points
551 views
0 votes
0 answers

Nodejs + Express vs Django: Choosing the best suitable backend component for given requirements

I'm trying to build a software architecture ...READ MORE

Aug 11, 2022 in Node-js by Neha
• 9,060 points
307 views
0 votes
0 answers

How to install NodeJS LTS on Windows as a local user (without admin rights)

I'm using Windows as a simple user ...READ MORE

Aug 11, 2022 in Node-js by Neha
• 9,060 points
1,425 views
0 votes
0 answers

npm command not working after installing nodejs in windows10?

i have installed nodejs from nodejs website. ...READ MORE

Aug 11, 2022 in Node-js by Neha
• 9,060 points
1,225 views
0 votes
0 answers

How to integrate soap xml API of unicommerce in nodejs?

I'm attempting to use the Node.js soap ...READ MORE

Aug 11, 2022 in Node-js by Neha
• 9,060 points
406 views
0 votes
0 answers

How to integrate soap xml API of unicommerce in nodejs

I am trying to hit xml Api ...READ MORE

Aug 11, 2022 in Node-js by Neha
• 9,060 points
511 views