Hi all, I had a functioning Node-RED app running on a linux server. I was working on another app on the same server that required the installation of "node-fetch". Following the installation of "node-fetch", I restarted node-RED and now it goes into errored status 1-2sec after starting.
Following the issue I tried uninstalling node-fetch to at least get access back to the initial application but node-red still seems to refer to node-fetch being in error.
Here are the error logs:
/home/nred/.pm2/pm2.log last 15 lines:
PM2 | 2023-08-22T15:59:12: PM2 log: App [node-red:2] online
PM2 | 2023-08-22T15:59:12: PM2 log: App [node-red:2] exited with code [0] via signal [SIGINT]
PM2 | 2023-08-22T15:59:12: PM2 log: App [node-red:2] starting in -fork mode-
PM2 | 2023-08-22T15:59:12: PM2 log: App [node-red:2] online
PM2 | 2023-08-22T15:59:13: PM2 log: App [node-red:2] exited with code [0] via signal [SIGINT]
PM2 | 2023-08-22T15:59:13: PM2 log: App [node-red:2] starting in -fork mode-
PM2 | 2023-08-22T15:59:13: PM2 log: App [node-red:2] online
PM2 | 2023-08-22T15:59:14: PM2 log: App [node-red:2] exited with code [0] via signal [SIGINT]
PM2 | 2023-08-22T15:59:14: PM2 log: App [node-red:2] starting in -fork mode-
PM2 | 2023-08-22T15:59:14: PM2 log: App [node-red:2] online
PM2 | 2023-08-22T15:59:15: PM2 log: App [node-red:2] exited with code [0] via signal [SIGINT]
PM2 | 2023-08-22T15:59:15: PM2 log: App [node-red:2] starting in -fork mode-
PM2 | 2023-08-22T15:59:15: PM2 log: App [node-red:2] online
PM2 | 2023-08-22T15:59:15: PM2 log: App [node-red:2] exited with code [0] via signal [SIGINT]
PM2 | 2023-08-22T15:59:15: PM2 log: Script /home/nred/.nvm/versions/node/v16.16.0/bin/node-red had too many unstable restarts (16). Stopped. "errored"
2|node-red | at Script.runInContext (node:vm:139:12)
2|node-red | at processMessage (/home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/10-function.js:401:33)
2|node-red | at FunctionNode._inputCallback (/home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/10-function.js:335:17)
2|node-red | at /home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
2|node-red | TypeError: Only absolute URLs are supported
2|node-red | at getNodeRequestOptions (/home/nred/.node-red/node_modules/node-fetch/lib/index.js:1327:9)
2|node-red | at /home/nred/.node-red/node_modules/node-fetch/lib/index.js:1440:19
2|node-red | at new Promise (<anonymous>)
2|node-red | at new fetch (/home/nred/.node-red/node_modules/node-fetch/lib/index.js:1437:9)
2|node-red | at Function node:13c3ef142b1f92f1 [function 2]:3:15
2|node-red | at Function node:13c3ef142b1f92f1 [function 2]:19:3
2|node-red | at Script.runInContext (node:vm:139:12)
2|node-red | at processMessage (/home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/10-function.js:401:33)
2|node-red | at FunctionNode._inputCallback (/home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/10-function.js:335:17)
2|node-red | at /home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
2|node-red | /home/nred/.node-red/settings.js:48
2|node-red | flowFilePretty: true,
2|node-red | ^
2|node-red |
2|node-red | SyntaxError: Unexpected token ':'
2|node-red | at Object.compileFunction (node:vm:352:18)
2|node-red | at wrapSafe (node:internal/modules/cjs/loader:1033:15)
2|node-red | at Module._compile (node:internal/modules/cjs/loader:1069:27)
2|node-red | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
2|node-red | at Module.load (node:internal/modules/cjs/loader:981:32)
2|node-red | at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2|node-red | at Module.require (node:internal/modules/cjs/loader:1005:19)
2|node-red | at Module.Hook._require.Module.require (/home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:101:39)
2|node-red | at require (node:internal/modules/cjs/helpers:102:18)
2|node-red | at Object.<anonymous> (/home/nred/.nvm/versions/node/v16.16.0/lib/node_modules/node-red/red.js:140:20)
I am not sure if the issue is with pm2 or node-red but please help if you have any idea how to solve this issue.
Thank you