LoginSignup
3
3

More than 5 years have passed since last update.

js-bson: Failed to load c++ bson extension, using pure JS versionの解決法

Posted at

https://registry.hub.docker.com/_/node/
公式のnode Docker Imageを使って, node x express4 x mongodb なアプリケーションを作ってbuild & runしたらエラーが出ました。

$ docker run --rm -it  myimage  node-dev ./bin/www
[Error: /opt/app/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release/bson.node: invalid ELF header]
js-bson: Failed to load c++ bson extension, using pure JS version

解決法

npm installした後に、

npm cache clean; rm -rf node_modules ;npm install

とすれば解決しました。
(なんでこれで直るのかはわかっていません。)

参考

バグ報告issue
https://github.com/mongodb/js-bson/issues/58

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3