node-canvas遇到NODE_MODULE_VERSION不一致的问题
Node 遇到 module version Canvas 一致 问题
2023-09-14 09:00:00 时间
在使用node-canvas时,由于更换了node版本遇到
Error: The module '\\?\D:\nodejs\node_modules\canvas\build\Release\canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
解决方法:
重新安装使用cnpm install canvas(不要使用npm或yarn安装,安装过几次都失败了)
或者从 https://github.com/node-gfx/node-canvas-prebuilt/releases直接下载编译好的包,替换掉 build\Release
说明:
NODE_MODULE_VERSION 83对应nodejs版本为Node.js 14.X
NODE_MODULE_VERSION 72对应nodejs版本为Node.js 12.X
NODE_MODULE_VERSION指的是Node.js的ABI(application binary interface)版本号,用来确定编译Node.js的C++库版本
nodejs同NODE_MODULE_VERSION对照
https://nodejs.org/en/download/releases/
相关文章
- [Node.js] Add node.js command line to global
- [Whole Web, Node.js, PM2] Restarting your node.js app on code change using pm2
- node爬虫进阶版
- [Tools] Create a Simple CLI Tool in Node.js with CAC
- [Whole Web] [Node.js] [Browserify] [Grunt] Automation task with grunt-browserify & grunt-contrib-watch
- [Node.js] Using npm link to use node modules that are "in progress"
- [Node.js]22. Level 4: Dependency
- 如何使用 multiparty 工具库在 Node.js 应用里解析 multipart form-data 格式的请求
- Node.js 应用访问 https 服务器时遇到的错误消息 unable to get local issuer certificate
- 使用node https module创建服务器遇到的mac verify failure错误消息
- 14 【node js 5/7】
- Unexpected XML declaration. The XML declaration must be the first node in the document and no white
- mac上node升级
- Node.js:npm管理包版本version
- GraphQL:Node.js代码实现简单例子