下面的节点错误是否意味着我需要升级串口模块,或者降级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有没有简单的方法来解决这个问题?
发布于 2018-11-24 05:59:43
完全移除nodejs npm,重新安装,运行nodejs main.js,然后根据需要使用npm安装包。现在起作用了。
https://stackoverflow.com/questions/53452548
复制相似问题