Unable to install/update nodes

Hi, I'm not able to install/update any node any more!! I even copied back the original settings.js in order to avoid any modification I was trying on it. From manage palette as well as from command line, I always get this error:
Raspberry pi3+ with debian buster
Node-RED version: v1.2.9
Node.js version: v12.21.0
Linux 5.10.17-v7+ arm LE

I have tryed with several nodes but it's always the same :frowning: (updating the existing nodes as well as installing new ones)

Failed to update node-red-contrib-cron-plus
Install failed
Check the log for more information

And this is the log.

2021-04-22T15:16:28.487Z Install : node-red-contrib-cron-plus 1.4.3
2021-04-22T15:16:28.756Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-cron-plus@1.4.3
2021-04-22T15:16:54.544Z [err] npm
2021-04-22T15:16:54.547Z [err]
2021-04-22T15:16:54.549Z [err] ERR!
2021-04-22T15:16:54.550Z [err] Maximum call stack size exceeded
2021-04-22T15:16:54.605Z [err]
2021-04-22T15:16:54.606Z [err] npm ERR! A complete log of this run can be found in:
2021-04-22T15:16:54.606Z [err] npm ERR! /home/pi/.npm/_logs/2021-04-22T15_16_54_554Z-debug.log
2021-04-22T15:16:54.653Z rc=1

And this is /home/pi/.npm/_logs/2021-04-22T15_16_54_554Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '--no-audit',
1 verbose cli '--no-update-notifier',
1 verbose cli '--no-fund',
1 verbose cli '--save',
1 verbose cli '--save-prefix=~',
1 verbose cli '--production',
1 verbose cli 'node-red-contrib-cron-plus@1.4.3'
1 verbose cli ]
2 info using npm@6.14.11
3 info using node@v12.21.0
4 verbose npm-session 83b3762bc883aae8
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/node-red-contrib-cron-plus 4689ms (from cache)
8 silly pacote version manifest for node-red-contrib-cron-plus@1.4.3 fetched in 4855ms
9 verbose stack RangeError: Maximum call stack size exceeded
9 verbose stack at /usr/lib/node_modules/npm/node_modules/aproba/index.js:39:16
9 verbose stack at Array.forEach ()
9 verbose stack at validate (/usr/lib/node_modules/npm/node_modules/aproba/index.js:34:11)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:37:3)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
9 verbose stack at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
10 verbose cwd /home/pi/.node-red
11 verbose Linux 5.10.17-v7+
12 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "node-red-co$
13 verbose node v12.21.0
14 verbose npm v6.14.11
15 error Maximum call stack size exceeded
16 verbose exit [ 1, true ]

It appears that npm is crashing for some reason. Either something has messed up npm itself, or your node_modules folder or package.json or package-lock.json are causing the problem.
What happened prior to the problem appearing? Knowing that may help to work out what to do about it.

I have two folders under .node-red (test_1 and test_2) that I run with separate node-red instances:
node-red -u /home/pi/.node-red/test_1 -s /home/pi/.node-red/settings.js -p 1881
node-red -u /home/pi/.node-red/test_2 -s /home/pi/.node-red/settings.js -p 1882
In each of these folders I made a simlink to .node-red/node_modules
Now, in order to simplify my backup process I wanted to move these 2 folder in another directory, so I copy-paste them recreating the simlink to .node-red/node_modules, leaving the original folders as they were,
Now I'm encountering this problem of installing/updating nodes from wherever, even running the simple node-red command

I even tryed with
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
but it exits without showing anything, as it hasn't been executed at all

I even tried to delete all the files in .node/red (including settings.js) so that running node-red it would recreate them all. But nothing, the problem still remains

Rename the .npm folder in your home directory, rename the .node-red folder and start node red in a terminal. If it won't go then post the log here.

In this way it works again, but I have to reinstall all the nodes :frowning:

Put package.json back and run
npm install

I suspect that it was getting rid of ~/.npm that fixed it, something in there may have been messed up by the experiments you were performing.

Yes, probably something messed up by my experiments