Recompiling node dependencies using a different version of node

I want to install some dependencies and in this case install node-pty. But when I run it, they give me this error:

Error: module '/ home / dev / Documents / project / node_web_kit / node_modules / node-pty / build / Release / pty.node' was compiled with a different version of Node.js using NODE_MODULE_VERSION 46. This version of Node.js requires NODE_MODULE_VERSION 51 .Try recompiling or reinstalling

any solutions?

+4


source to share


3 answers


The easiest way is to just delete node_modules and re-run npm i

from scratch, this way all modules will certainly be configured for the new version of Node.



+5


source


Rebuild the node-pty module using:



npm rebuild node-pty --update-binary

+1


source


If none of the above helps, try rebuilding the package manually:

cd node_modules/<your module>
node-pre-gyp rebuild

      

This worked for me

0


source







All Articles