使用另一个节点版本重新编译节点依赖项

[英]Recompiling node dependencies using another node version


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

我想安装一些依赖项,在这种情况下安装node-pty。但是,当我运行它时,他们给我这个错误:

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

错误:模块'/home/dev/Documents/project/node_web_kit/node_modules/node-pty/build/Release/pty.node'是使用NODE_MODULE_VERSION 46针对不同的Node.js版本编译的。此版本的Node.js需要NODE_MODULE_VERSION 51.请尝试重新编译或重新安装

any solutions?

任何解决方案

2 个解决方案

#1


5  

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.

最简单的方法是删除node_modules并从头开始重新运行npm i,这样就可以为新的Node版本设置所有模块。

#2


1  

Rebuild the node-pty module using:

使用以下命令重建node-pty模块:

npm rebuild node-pty --update-binary

npm rebuild node-pty --update-binary

关注微信公众号

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2017/04/01/55339b9757d1a69b048a6542ea129d29.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com