以下 Node 错误是否意味着我需要升级串口模块,或降级nodejs,或其他什么? (它曾经有效,直到我将 ubuntu 从 16.04 更新到 18.04)
Error: The module '../node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 67. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
我已经尝试过:
rm package-lock.json;
rm -rf node_modules;
npm install
npm rebuild
npm install serialport --build-from-source
sudo npm install serialport --unsafe-perm --build-from-source
有没有简单的方法可以解决这个问题?
最佳答案
完全删除nodejs npm,安装并运行node js main.js,然后使用npm 根据需要安装软件包。现在可以工作了。
关于node.js - "serialport" Node 模块版本错误消息令人困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53452548/