All Questions
Tagged with error-handling node.js
1,298
questions
-1
votes
0
answers
13
views
npx error. the npx did not run what should i do for this
npm error could not determine executable to run
npm error A complete log of this run can be found in: C:\Users\Manuj\AppData\Local\npm-cache_logs\2024-07-19T07_10_33_916Z-debug-0.log
i try to run npx ...
0
votes
0
answers
37
views
How to handle deliberate errors for testing Axios requests with invalid credentials in Node.js?
I'm developing a Node.js script that interacts with the Microsoft Graph API using Axios for fetching user information and group memberships. To test error handling scenarios, I deliberately used ...
-7
votes
0
answers
123
views
+500
How to properly handle internal/external API errors in service-, data- & app layers in Next.js? [closed]
I'm building a Next application with the following layers:
lib/service (async server-only functions doing a fetch from an external api and returning the data)
data (async server-only functions that ...
-2
votes
1
answer
19
views
React Native package download issue
[I am getting this error. I have no issue working on react.js. The node is correctly installed as i can get the versions]
I am not also able to find the path for npm using which or whereis
[I tried ...
-1
votes
0
answers
58
views
How to fix error `SyntaxError: Unexpected token '='` in React-native expo
I have node.js of version 18.18.0 on machine before and my react-native app was working just fine. But I recently installed lower version of node.js 14.0.0 using nvm and When I start my expo react-...
0
votes
0
answers
19
views
Ensuring Atomicity in Node Js Controller Operations Including Stripe API Calls
I am facing an issue in my Node Js application where I need to ensure that operations in my controller either all succeed together or none of them succeed. Here is the scenario:
In my Node Js ...
1
vote
0
answers
39
views
NodeJS request to IPInfo.io seems to escape try-catch block
I have a NodeJS server and I use IPInfo.io to check which country visitors come from. I get an error from the response of IPInfo.io that crashes the server:
SyntaxError: Unexpected token o in JSON at ...
0
votes
2
answers
249
views
NodeJS Fetch: Handle Network Error Type on same fetch request
How I check network error type on same request?
My nodejs code:
try {
const response= await fetch("https://app.local")
} catch (err) {
console.log(err);
}
I get on console:
...
1
vote
1
answer
34
views
error handling outputs html instead json in express
i followed the express.js 's tutorial to make a simple errorhandler
function clientErrorHandler(err, req, res, next) {
if (req.xhr) {
console.log('clienterrorhandler', err);
res.status(500)....
-1
votes
1
answer
70
views
status code:400 bad request occurs, unable get error message from backend
const downloadSif = () => {
const apiClient = new APIClient(PAYROLL_CYCLE_SIF_ENDPOINT(params.id!));
apiClient
.get(true)
.then((data) => {
console.log(data);
...
0
votes
0
answers
75
views
How to fix "Error: Cannot find module './cli/validate-engines.js'" after running npm -v after installing Node.js v20.13.1 (LTS)?
After I install Node.js v20.13.1 (LTS) and execute "npm -v" in command prompt, I get the following error. How can I fix?
PS C:\Users\alexc\Repositories\ProjectThree> npm -v
node:internal/...
0
votes
0
answers
32
views
Node.js Server Error: EADDRINUSE - Address Already in Use Despite Terminating Process
After 1st time successfully started server and when I again start my server then I'm encountering an issue with my Node.js server where I receive the following error message:
node:events:496
throw er; ...
1
vote
1
answer
57
views
Is there a list of error codes for WebSocket from the Node.JS ws package?
I'm writing a simple application with Node that connects to a WebSocket server and retrieve's some information on a set interval. The application needs to be able to handle the possibility of ...
0
votes
0
answers
41
views
multiple errors in production enviroment while working fine in dev
I use Digital Ocean App Platform to run my app...
I receive these error messages =>
node:internal/process/promises:289
[distware] [2024-04-29 09:12:50] triggerUncaughtException(err, ...
0
votes
0
answers
18
views
How do I fix this WebSocket error in my app?
I have code below that proxies a WebSocket connection:
app.ws("/", async (socket) => {
api = new WebSocket("wss://example.com/?v=2", [], {
headers: {
&...