MODULE_NOT FOUND error breaking Node-RED after upgrade (Windows)

Hi, I've had an instance of Node-RED running happily on my Windows 10 machine for some time. As I was about to go and revise some old flows, I thought I'd also take this opportunity to update to the latest version. (I believe I was previously running v1.0.0).

So, from the command line, I issued a

npm install -g --unsafe-perm node-red

This produced a couple of warnings, but otherwise appeared succesful:

C:\Users\alast\AppData\Roaming\npm>npm install -g --unsafe-perm node-red
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
C:\Users\alast\AppData\Roaming\npm\node-red-pi -> C:\Users\alast\AppData\Roaming\npm\node_modules\node-red\bin\node-red-pi
C:\Users\alast\AppData\Roaming\npm\node-red -> C:\Users\alast\AppData\Roaming\npm\node_modules\node-red\red.js
npm WARN ws@7.4.2 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.2 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

As far as I understand, that should be the only step required (as found here: How to update / upgrade on Windows). However, now when trying to start the Node-RED process, I get the following error:

  throw e;

Error: Package exports for 'C:\Users\alast\AppData\Roaming\npm\node_modules\node-red\node_modules\async-mutex' do not define a valid '.' target
    at resolveExportsTarget (internal/modules/cjs/loader.js:460:13)
    at resolveExports (internal/modules/cjs/loader.js:393:16)
    at Function.Module._findPath (internal/modules/cjs/loader.js:492:20)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:787:27)
    at Function.Module._load (internal/modules/cjs/loader.js:693:27)
    at Module.require (internal/modules/cjs/loader.js:864:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\alast\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\runtime\lib\api\flows.js:37:13)
    at Module._compile (internal/modules/cjs/loader.js:971:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10) {

Any advice would be greatly appreciated!

Ok, so updating Node.js to LTS v14.15.4 seems to have solved it (didn't realise that was a dependency - I think I was on v12 before which had been running fine)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.