Unable to start node-red Windows

After start node-red I see the next error.

How to solve it?

4 Oct 15:30:41 - Error: The module '\\?\C:\Users\DELL\.node-red\node_modules\serialport\build\Release\serialport.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at bindings (C:\Users\DELL\.node-red\node_modules\bindings\bindings.js:81:44)
    at Object.<anonymous> (C:\Users\DELL\.node-red\node_modules\serialport\lib\bindings\win32.js:2:36)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\DELL\.node-red\node_modules\serialport\lib\bindings\auto-detect.js:8:22)

The error is reasonably clear. The serial node was compiled against a different version of node.js than the one you actually have installed.

There are various ways to fix that but personally, I tend to just delete the .node-red\node_modules\ folder and then from a command line:

cd C:\Users\DELL\.node-red\
npm install

That should do it.

If you are of a nervous disposition - or just cautious - rename the node_modules folder instead of deleting it.

As always with node.js apps, make sure that you have installed build-essentials first.

1 Like

Thank you for an answer. I did it yesterday.
All work fine now.