本文介绍了使用纯JS版本无法加载c ++ bson扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

justhacker@justhacker-ThinkPad-Edge-E440:~/tools/codes/microblog$ node app.js
Failed to load c++ bson extension, using pure JS version

/home/justhacker/tools/codes/microblog/node_modules/express/lib/express.js:89

throw new Error('Most middleware (like ' + name + ') is no longer bundle             ^

Error: Most middleware (like session) is no longer bundled with Express and must be

installed separately. Please see https://github.com/senchalabs/connect#middleware.

at Function.Object.defineProperty.get

(/home/justhacker/tools/codes/microblog/node_modules/express/lib/express.js:89:13)

at module.exports (/home/justhacker/tools/codes/microblog/node_modules/connect-

mongo/lib/connect-mongo.js:30:22)

at Object.<anonymous> (/home/justhacker/tools/codes/microblog/app.js:14:42)

at Module._compile (module.js:449:26)

at Object.Module._extensions..js (module.js:467:10)

at Module.load (module.js:349:32)

at Function.Module._load (module.js:305:12)

at Function.Module.runMain (module.js:490:10)

at startup (node.js:124:16)

at node.js:807:3

推荐答案

实际错误是由4.0版本中的明示更改引起的.现在,大多数随附的中间件都以独立" npm软件包的形式提供.您可以在此处详细了解.

The actual error is caused by express changes in 4.0 version. Most of the included middlewares now come as "stand-alone" npm packages. You can read more about the changes here.

关于Failed to load c++ bson extension, using pure JS version.错误,您可能缺少python/gcc.您可以在此处了解有关此错误的更多信息: node.js-无法加载c ++ bson扩展.如果这样不能解决您的问题,请尝试删除/重新安装驱动程序/插件.

About the Failed to load c++ bson extension, using pure JS version. error, you're probably missing python/gcc.You can read more about this error here: node.js - Failed to load c++ bson extension. If this don't fix your issue, try removing/reinstalling the driver/plugin.

这篇关于使用纯JS版本无法加载c ++ bson扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 16:33
查看更多