tagged [node.js]

How to programmatically send a 404 response with Express/Node?

How to programmatically send a 404 response with Express/Node? I want to simulate a 404 error on my Express/Node server. How can I do that?

node.js require all files in a folder?

node.js require all files in a folder? How do I require all files in a folder in node.js? need something like:

5 May at 15:32

node.js hash string?

node.js hash string? I have a string that I want to hash. What's the easiest way to generate the hash in node.js? The hash is for versioning, not security.

21 Feb at 17:50

NPM clean modules

NPM clean modules Is there a way to get npm to unbuild all the modules under node_modules? Something like npm rebuild that removes all build artifacts but doesn't rebuild them?

5 Jul at 20:5

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

How do you reinstall an app's dependencies using npm? Is there a simple way to reinstall packages that my app depends on (i.e. they are in my apps node_modules folder)?

12 Oct at 20:18

How to change value of process.env.PORT in node.js?

How to change value of process.env.PORT in node.js? I'd like to change the value of `process.env.PORT`, how can I do this? I'm running Ubuntu 12.04.

30 Jun at 19:20

Node.js: Difference between req.query[] and req.params

Node.js: Difference between req.query[] and req.params Is there a difference between obtaining QUERY_STRING arguments via `req.query[myParam]` and `req.params.myParam`? If so, when should I use which?

3 Oct at 07:15

How to change port number in vue-cli project

How to change port number in vue-cli project How to change Port number in Vue-cli project so that it run's on another port instead of 8080.

RangeError: Invalid time value

RangeError: Invalid time value I'm getting frequent errors when i start my server. Here is the error: Here is the code:

31 Jan at 14:5

Writing to files in Node.js

Writing to files in Node.js I've been trying to find a way to write to a file when using Node.js, but with no success. How can I do that?

8 Mar at 09:36

What is Node.js' Connect, Express and "middleware"?

What is Node.js' Connect, Express and "middleware"? Despite knowing JavaScript quite well, I'm confused what these three projects in Node.js ecosystem do. Is it something like Rails' Rack? Can someone...

25 Jul at 05:19

Configure Node.js to log to a file instead of the console

Configure Node.js to log to a file instead of the console Can I configure `console.log` so that the logs are written on a file instead of being printed in the console?

23 Nov at 15:48

Fastest way to copy a file in Node.js

Fastest way to copy a file in Node.js The project that I am working on (Node.js) implies lots of operations with the file system (copying, reading, writing, etc.). Which methods are the fastest?

27 Oct at 19:47

NodeJS / Express: what is "app.use"?

NodeJS / Express: what is "app.use"? In the [docs for the NodeJS express module](http://expressjs.com/guide.html), the example code has `app.use(...)`. What is the `use` function and where is it defin...

21 Oct at 11:23

How do you completely remove Ionic and Cordova installation from mac?

How do you completely remove Ionic and Cordova installation from mac? How can I remove Cordova and ionic installation from my Mac completely? I am running mac os Yosemite 10.10.2

How to host servicestack on node.js?

How to host servicestack on node.js? We have a Icneium Hybrid Mobile app accessing servicestack REST services. Is it OK to host the servicestack on Node.js instead of IIS? Any examples are highly appr...

19 Feb at 13:33

What is the difference between res.end() and res.send()?

What is the difference between res.end() and res.send()? I'm a beginner in `Express.js` and I'm confused by these two keywords: `res.end()` and `res.send()`. Are they the same or different?

24 Jul at 14:56

bower command not found

bower command not found I tried to install twitter bower on my Mac, and I used Then I tried `bower --help`, and the output was `bower command not found`. Why is that?

11 May at 03:26

How can I set response header on express.js assets

How can I set response header on express.js assets I need to set CORS to be enabled on scripts served by express. How can I set the headers in these returned responses for public/assets?

20 May at 05:48

Is there a way to make npm install (the command) to work behind proxy?

Is there a way to make npm install (the command) to work behind proxy? Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages an...

9 Jan at 09:53

How can I get date in application run by node.js?

How can I get date in application run by node.js? Do I have to manually run `date` command using child_process and fetch the result from it to get the date? Is there any other way using node?

22 Jan at 21:12

npm - how to show the latest version of a package

npm - how to show the latest version of a package How do I use npm to show the latest version of a module? I am expecting something like `npm --latest express` to print out `v3.0.0`.

4 Nov at 09:1

How to end a session in ExpressJS

How to end a session in ExpressJS I feel like this has to be buried somewhere in the documentation, but I can't find it. How do you close or end or kill (whatever) a session in ExpressJS?

1 Dec at 22:18

MySQL with Node.js

MySQL with Node.js I've just started getting into Node.js. I come from a PHP background, so I'm fairly used to using MySQL for all my database needs. How can I use MySQL with Node.js?

21 Nov at 12:49

NVM for Windows not working?

NVM for Windows not working? I just installed [NVM for Windows](https://github.com/coreybutler/nvm-windows), but it doesn't seem to be working: ![nvm from command line](https://i.stack.imgur.com/RByry...

4 Feb at 04:13