Latest questions in Node-js

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

How to show the latest version of a package?

Hello @kartik, You can use: npm show {pkg} version (so npm ...READ MORE

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

How to Get data from fs.readFile?

Hello @kartik, The function you have defined is ...READ MORE

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

How to reload or re-render the entire page using AngularJS?

Hello @kartik< For the record, to force angular ...READ MORE

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

How to stop node.js program from command line?

Hello @kartik, Ctrl+Z suspends it, which means it can ...READ MORE

Jul 15, 2020 in Node-js by Niroj
• 82,880 points
18,264 views
0 votes
1 answer

How to include scripts located inside the node_modules folder?

Hello @kartik, I would use the path npm ...READ MORE

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

How do I URl encode something in Node.js?

Hello @kartik, The built-in module querystring is what you're looking ...READ MORE

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

How do I install node-sass using VSCode?

Hello @ Ebuka, Here is the following things you ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,880 points
4,982 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,880 points
35,421 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,172 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,394 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,036 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,403 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,001 views
0 votes
0 answers

How to install a private NPM module without my own registry?

I've taken some code and put it in ...READ MORE

Jul 13, 2020 in Node-js by kartik
• 37,510 points
1,357 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,416 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,018 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,478 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
654 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,590 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,311 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
395 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,157 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,937 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,285 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,217 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,633 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,740 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,679 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,823 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
5,990 views
0 votes
0 answers

How to append to a file in Node?

I am trying to append a string to a ...READ MORE

Jul 9, 2020 in Node-js by kartik
• 37,510 points
754 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
590 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,906 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,314 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,702 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
2,990 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
521 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,648 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,544 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,441 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,808 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
2,971 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
872 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
682 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,360 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
756 views