Problem installing module

I am trying to intall a module, but the error appears:

2022-10-16T22:24:08.830Z Install : node-red-node-email 1.18.1

2022-10-16T22:24:09.165Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-node-email@1.18.1
2022-10-16T22:24:12.572Z [err] npm
2022-10-16T22:24:12.572Z [err] ERR! Windows_NT 10.0.22000
2022-10-16T22:24:12.572Z [err] npm
2022-10-16T22:24:12.573Z [err] ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Microsoft Windows\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "--engine-strict" "node-red-node-email@1.18.1"
2022-10-16T22:24:12.574Z [err] npm ERR! node v16.18.0
2022-10-16T22:24:12.574Z [err] npm ERR! npm v3.10.10
2022-10-16T22:24:12.575Z [err]
2022-10-16T22:24:12.576Z [err] npm
2022-10-16T22:24:12.576Z [err] ERR!
2022-10-16T22:24:12.577Z [err] cb.apply is not a function
2022-10-16T22:24:12.577Z [err] npm ERR!
2022-10-16T22:24:12.577Z [err]
2022-10-16T22:24:12.577Z [err] npm ERR! If you need help, you may report this error at:
2022-10-16T22:24:12.577Z [err] npm ERR!
2022-10-16T22:24:12.577Z [err] https://github.com/npm/npm/issues
2022-10-16T22:24:12.598Z [err]
2022-10-16T22:24:12.598Z [err] npm ERR! Please include the following file with any support request:
2022-10-16T22:24:12.598Z [err] npm ERR!
2022-10-16T22:24:12.598Z [err] C:\Users\Microsoft Windows.node-red\npm-debug.log
2022-10-16T22:24:12.632Z rc=1

Welcome to the forum @LuisF

That is a good version of node.js (16.18.0) but with that version of nodejs, npm should be version 8.15 or similar. I don't use Windows so don't know the fix, but I suggest that you start with the node red docs Installing on Windows and see what it says about installing node.js and npm.

Not sure why that would get out of step since a Windows install of node.js will install the appropriate npm. I guess it might be possible that you have an old version of npm hanging around somewhere that is being picked up?

If you are using PowerShell, you should be able to do whereis npm just like on Linux (if using CMD, then it is where npm):

image

If you get anything different to that, please share.