使用另一个节点版本重新编译节点依赖项 [英] Recompiling node dependencies using another node version
问题描述
我想安装一些依赖项,在这种情况下安装 node-pty.但是当我运行它时,他们给了我这个错误:
I want to install some dependencies and in this case installing node-pty. But when I run it they give me this error:
错误:模块'/home/dev/Documents/project/node_web_kit/node_modules/node-pty/build/Release/pty.node'使用不同的 Node.js 版本编译NODE_MODULE_VERSION 46. 这个版本的 Node.js 需要NODE_MODULE_VERSION 51. 请尝试重新编译或重新安装
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
有什么解决办法吗?
推荐答案
最简单的确定方法就是删除 node_modules 并重新运行 npm i
,这样所有模块肯定会为新的 Node 版本进行设置.
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.
这篇关于使用另一个节点版本重新编译节点依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!