Full-Node

Bcoin 因節點版本錯誤而崩潰

  • August 3, 2017

我安裝了 bcoin 並收到有關版本的此錯誤:

$ node -v
v8.2.1
$ npm -v
5.3.0
$ bcoin
/usr/lib/node_modules/bcoin/lib/db/backends.js:26
   throw e;
    ^
Error: The module '/usr/lib/node_modules/bcoin/node_modules/leveldown/build/Release/leveldown.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. 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`).
   at Object.Module._extensions..node (module.js:598:18)
   at Module.load (module.js:503:32)
   at tryModuleLoad (module.js:466:12)
   at Function.Module._load (module.js:458:3)
   at Module.require (module.js:513:17)
   at require (internal/module.js:11:18)
   at bindings (/usr/lib/node_modules/bcoin/node_modules/leveldown/node_modules/bindings/bindings.js:76:44)
   at Object.<anonymous> (/usr/lib/node_modules/bcoin/node_modules/leveldown/leveldown.js:4:46)
   at Module._compile (module.js:569:30)
   at Object.Module._extensions..js (module.js:580:10)

任何想法為什麼?

這可能是因為您在安裝 bcoin 後更新了節點版本。您需要重新編譯 leveldown 模組的 C++ 綁定來解決此問題。結帳 npm 重建:https ://docs.npmjs.com/cli/rebuild

引用自:https://bitcoin.stackexchange.com/questions/57554