Recompiling node dependencies using another node v

2019-02-13 21:45发布

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

Error: The module '/home/dev/Documents/project/node_web_kit/node_modules/node-pty/build/Release/pty.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 46. This version of Node.js requires NODE_MODULE_VERSION 51. Please try re-compiling or re-installing

any solutions?

3条回答
▲ chillily
2楼-- · 2019-02-13 22:13

If none of the above worked try rebuilding the package manually:

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

This worked for me

查看更多
forever°为你锁心
3楼-- · 2019-02-13 22:24

Rebuild the node-pty module using:

npm rebuild node-pty --update-binary

查看更多
Bombasti
4楼-- · 2019-02-13 22:27

The simplest way to be sure is just to delete node_modules and re-run npm i from scratch, that way all modules will definitely be set up for the new Node version.

查看更多
登录 后发表回答