Most voted questions in Node-js

0 votes
1 answer

Error:npm install won't install devDependencies

Hello @kartik, Try: npm install --only=dev If you are worried ...READ MORE

Jul 15, 2020 in Node-js by Niroj
• 82,880 points
6,835 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,880 points
22,428 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
608 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,695 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,703 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,623 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,562 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,157 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
5,034 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
36,074 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,329 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,456 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,461 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,192 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,381 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,572 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,301 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,542 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
687 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,770 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,345 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
418 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,193 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,981 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,322 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,763 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,777 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,879 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,882 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,087 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
770 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
647 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,950 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,353 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,752 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,037 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
577 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,705 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,589 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
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,021 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
899 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
–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,839 views