Skip to content

Tag: node.js

Can’t install any NPM package, error 4058

I’m trying to install Grunt on my project. It used to work perfectly, but now for some reason, it does not. Every time i try to install Grunt, I got this error: The weird thing is that the missing package change every time. I try verifying the cache, removing the node_modules folder, cleaning the cache …

await is only valid in async function

I wrote this code in lib/helper.js: Then I tried to use it in another file : I got an error: What is the issue? Answer The error is not refering to myfunction but to start. I use the opportunity of this question to advise you about an known anti pattern using await which is : return await. WRONG CORRECT Also,

ReactJS and Node — Error 400 bad request

I am trying to build a react application which saves data into database. I have the following classes: server.js and SaveNewCard.js But I got the following Bad Request 400 error: And: As I can understand, my request does not contain the inserted data… I assume the problem is here somewhere….: I le…

Returning data from Axios API [duplicate]

This question already has answers here: How do I return the response from an asynchronous call? (41 answers) Closed 3 months ago. I am trying to use a Node.JS application to make and receive API requests. It does a get request to another server using Axios with data it receives from an API call it receives. T…