【问题标题】:Fix Node.js version problem " Please try re-compiling or re-installing"修复 Node.js 版本问题“请尝试重新编译或重新安装”
【发布时间】:2021-07-01 15:16:50
【问题描述】:

我已经尝试擦除我的 node_modules 并重新安装、多次运行 npm rebuild、更改 Node 版本和 npm rebuild my_module_name --update-binary。没有任何效果。

编辑:此软件包以前已安装并且可以正常工作。包链接与 Windows 兼容。它只是在一段时间没有运行脚本后停止工作。我尝试按照页面上的内容进行操作,并确保我安装了最新版本的 Microsoft Visual C++ Redistributable。我仍然遇到同样的错误。

Error: The module './././**PATH**\node_modules\@nut-tree\nut-js\node_modules\opencv4nodejs-prebuilt\build\Release\opencv4nodejs.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 79. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`)

【问题讨论】:

    标签: node.js opencv4nodejs


    【解决方案1】:

    这表明您正在使用 Node 版本管理器或最近更新了您的 Node 版本,并且您的包的编译版本与您当前的 Node 版本不匹配。如果您使用的是 Node 版本管理器,请仔细检查您是否使用了正确的 Node 版本。否则,您只需删除项目的node_modules 文件夹,然后运行npm install

    【讨论】:

    • 我现在收到一个错误:npm ERR! Installing prebuilt OpenCV vundefined for plattform win32 npm ERR! npm ERR! code ETARGET npm ERR! npm ERR! notarget No matching version found for @nut-tree/opencv-build-win32@undefined.
    • 这意味着您正在尝试安装与 Windows 不兼容的软件包。您应该改用 WSL2。
    • 这个包以前安装过并且可以工作。包link 与Windows 兼容。它只是在一段时间没有运行脚本后停止工作。我尝试按照页面上的说明进行操作,并确保安装了最新版本的 Microsoft Visual C++ Redistributable。我仍然遇到同样的错误。
    猜你喜欢
    • 2018-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-24
    • 1970-01-01
    • 1970-01-01
    • 2019-05-25
    • 2019-05-23
    相关资源
    最近更新 更多