我是 node.js 和 express 的初学者,我一直在关注http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/作为入门参考。我正在构建一个小应用程序来使用jade显示我的mongodb集合中的数据。但是,我在npm start中遇到了这些错误。
> nodetest1@0.0.0 start C:\node\nodetest1
> node ./bin/www
{ Error: Cannot find module '../build/Release/bson'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\node\nodetest1\node_modules\bson\ext\index.js:15:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
C:\node\nodetest1\app.js:50
app.use('/', routes);
^
ReferenceError: routes is not defined
at Object.<anonymous> (C:\node\nodetest1\app.js:50:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\node\nodetest1\bin\www:7:11)
at Module._compile (module.js:570:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodetest1@0.0.0 start: `node ./bin/www
enter code here`npm ERR! Exit status 1
enter code here`npm ERR!
enter code here`npm ERR! Failed at the nodetest1@0.0.0 start script.
enter code here`npm ERR! This is probably not a problem with npm. There is likely additional code logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2017-09-16T17_48_47_843Z-debug.log
PS C:\node\nodetest1>
我尝试在 npm Official Docs 中搜索错误,但甚至将我的 npm 更新到了最新版本。但这是我得到的最新一组错误。没有线索。任何帮助或提示都会非常有帮助。