node-v17.6.0 上的 node_module_version 错误

发布于 2025-01-11 10:51:03 字数 1482 浏览 0 评论 0原文

我无法在电子上运行节点画布。说以下问题。

NODE_MODULE_VERSION 102。此版本的 Node.js 需要
NODE_MODULE_VERSION 101.请尝试重新编译或重新安装

npm版本: $ npm -v
8.5.1
节点版本: $ 节点-v
17.6.0

依赖项: 此处的依赖项

D:\test-app-latest/node_modules/sha1
Error occurred in handler for 'start-generate': Error: The module '\\?\D:\test-app-latest\node_modules\canvas\build\Release\canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 101. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\test-app-latest\node_modules\canvas\lib\bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1116:14) {
  code: 'ERR_DLOPEN_FAILED'
}

I can't run node-canvas on electron. says the following issues.

NODE_MODULE_VERSION 102. This version of Node.js requires

NODE_MODULE_VERSION 101. Please try re-compiling or re-installing

npm version:
$ npm -v
8.5.1

node version:
$ node -v

17.6.0

Dependencies:
Dependencies Here

D:\test-app-latest/node_modules/sha1
Error occurred in handler for 'start-generate': Error: The module '\\?\D:\test-app-latest\node_modules\canvas\build\Release\canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 101. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\test-app-latest\node_modules\canvas\lib\bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1116:14) {
  code: 'ERR_DLOPEN_FAILED'
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文