hexo 指令报错

很久没有写博客了,这两天准备重新写的时候,发现hexo指令都报如下错误:

1
2
3
4
Error: The module '/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
was compiled against a different Node.js version usingNODE_MODULE_VERSION 48.
This version of Node.js requiresNODE_MODULE_VERSION 59.
Please try re-compiling or re-installingthe module (for instance, using `npm rebuild` or `npm install`).

解决方案是:删掉/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider这个目录,然后执行npm i

参考链接:https://stackoverflow.com/questions/43158417/recompiling-node-dependencies-using-another-node-version