下载了 mongoose 放在nodeclub\node_modules\ 下后 然后运行app后 还是弹出错误
TypeError: Invalid select() argument. Must be a string or object.
at Query.select (E:\Project\nodeclub\node_modules\mongoose\lib\query.js:1242:11)
at Function.find (E:\Project\nodeclub\node_modules\mongoose\lib\model.js:804:9)
at Object.exports.getAllTags (E:\Project\nodeclub\proxy\tag.js:28:7)
at exports.index (E:\Project\nodeclub\controllers\site.js:58:7)
at callbacks (E:\Project\nodeclub\node_modules\express\lib\router\index.js:272:11)
at param (E:\Project\nodeclub\node_modules\express\lib\router\index.js:246:11)
at pass (E:\Project\nodeclub\node_modules\express\lib\router\index.js:253:5)
at Router._dispatch (E:\Project\nodeclub\node_modules\express\lib\router\index.js:280:5)
at Object.Router.middleware [as handle] (E:\Project\nodeclub\node_modules\express\lib\router\index.js:45:10)
at next (E:\Project\nodeclub\node_modules\express\node_modules\connect\lib\http.js:204:15)
求教解决上述问题, 在windows下顺利运行 nodeclub
3 回复
昨天我也遇到了相同的问题。原因在于你使用的mongoose版本。 如果你使用的是3.x.x版本的mongoose,建议卸载后重新装一个2.7.0版的
$ npm install [email protected]
新版的mongoose对API进行了调整,会报
TypeError: Invalid select() argument. Must be a string or object.