tagged [node.js]

await is only valid in async function

await is only valid in async function I wrote this code in `lib/helper.js`: Then I tried to use it in another file : ``` var helper = require('./helper.js'); var start = function(a,b){ .... cons...

9 Jul at 11:37

Is there any way to configure multiple registries in a single npmrc file

Is there any way to configure multiple registries in a single npmrc file Here is my problem. We have a private NPM registry which only works in VPN. I would like to have a fallback registry [https://r...

5 Jul at 08:30

node.js, socket.io with SSL

node.js, socket.io with SSL I'm trying to get socket.io running with my SSL certificate however, it will not connect. I based my code off the chat example: ``` var https = require('https'); var fs = r...

21 Jun at 15:42

Node.js check if file exists

Node.js check if file exists How do I check for the existence of a file?

19 Jun at 22:34

How do I get the domain originating the request in express.js?

How do I get the domain originating the request in express.js? I'm using express.js and I need to know the domain which is originating the call. This is the simple code How do I get the domain from th...

19 Jun at 09:56

"Error: Cannot find module html" when visiting HTML page

"Error: Cannot find module html" when visiting HTML page When I started my application, and visited `localhost:8333` in my browser, it threw an error: ``` Error: Cannot find module 'html' at Function...

13 Jun at 08:50

Render basic HTML view?

Render basic HTML view? I have a basic Node.js app that I am trying to get off the ground using the Express framework. I have a `views` folder where I have an `index.html` file. But I receive the foll...

Node.js can't create Blobs?

Node.js can't create Blobs? I am working with node.js and I streamed my Audio to my node.js server. Now I noticed during the process of building the audio blob: That I get a ReferenceError at new Blob...

10 Jun at 07:4

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

How to fix error- nodemon.ps1 cannot be loaded because running scripts is disabled on this system, (without security risk)?

How to fix error- nodemon.ps1 cannot be loaded because running scripts is disabled on this system, (without security risk)? Error on terminal: `nodemon.ps1` cannot be loaded because running scripts is...

Run JavaScript in Visual Studio Code

Run JavaScript in Visual Studio Code Is there a way to execute JavaScript and display the results using ? For example, a script file containing: I assume that Node.js would be needed but can't work ou...

What is the purpose of Node.js module.exports and how do you use it?

What is the purpose of Node.js module.exports and how do you use it? What is the purpose of Node.js `module.exports` and how do you use it? I can't seem to find any information on this, but it appears...

9 Apr at 20:40

Message "the term 'ng' is not recognized as the name of a cmdlet"

Message "the term 'ng' is not recognized as the name of a cmdlet" Today, while working through some basic AngularJS introduction, I ran into a problem. I opened PowerShell to get going on the project....

Get file name from absolute path in Nodejs?

Get file name from absolute path in Nodejs? How can I get the file name from an absolute path in Nodejs? e.g. `"foo.txt"` from `"/var/www/foo.txt"` I know it works with a string operation, like `fullp...

8 Apr at 08:12

WebSockets and Apache proxy: how to configure mod_proxy_wstunnel?

WebSockets and Apache proxy: how to configure mod_proxy_wstunnel? I have : 1. Apache 2.4 on port 80 of my server, with mod_proxy and mod_proxy_wstunnel enabled 2. Node.js + socket.io on port 3001 of t...

fs.writeFile in a promise, asynchronous-synchronous stuff

fs.writeFile in a promise, asynchronous-synchronous stuff I need some help with my code. I'm new at Node.js and have a lot of trouble with it. What I'm trying to do: 1. Fetch a .txt with Amazon produc...

How do I add validation to the form in my React component?

How do I add validation to the form in my React component? My Contact page form is as follows, ```

How can I update NodeJS and NPM to their latest versions?

How can I update NodeJS and NPM to their latest versions? ### I just installed Node.js & NPM (Node Package Manager) I installed NPM for access to additional Modules. After I installed Node.js & NPM I ...

Is it safe to store a JWT in localStorage with ReactJS?

Is it safe to store a JWT in localStorage with ReactJS? I'm currently building a single page application using ReactJS. I read that one of the reasons for not using `localStorage` is because of XSS vu...

Why isn't Node Version Manager (NVM) recognized on Windows?

Why isn't Node Version Manager (NVM) recognized on Windows? I am trying to downgrade my version of node I ran: and I exported the bin folder to my Windows path variable, but I still get: > 'nvm' is no...

9 Mar at 09:13

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

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.

Write a line into a .txt file with Node.js

Write a line into a .txt file with Node.js I want to use Node.js to create a simple logging system which prints a line before the past line into a .txt file. However, I don't know how the file system ...

2 Feb at 17:23

Find (and kill) process locking port 3000 on Mac

Find (and kill) process locking port 3000 on Mac How do I find (and kill) processes that listen to/use my TCP ports? I'm on macOS. Sometimes, after a crash or some bug, my Rails app is locking port 30...

27 Jan at 02:30

Using Node.js require vs. ES6 import/export

Using Node.js require vs. ES6 import/export In a project I am collaborating on, we have two choices on which module system we can use: 1. Importing modules using require, and exporting using module.ex...