首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Openshift上运行MEAN时会出现非常奇怪的Mongoose/MongoDB问题

在Openshift上运行MEAN时会出现非常奇怪的Mongoose/MongoDB问题
EN

Stack Overflow用户
提问于 2014-07-20 04:29:44
回答 1查看 584关注 0票数 1

我已经上传了一个网站到Openshift.我不得不让许多changes...including学习版本化和nvm (节点版本管理器)。为了实现这些请求,我不得不看了很多npm版本的内容(也就是说,服务器使用的是快递版本3.2.5,而我在本地使用的是4.2.0 )。无论如何,现在我正在讨论一个奇怪的问题,在这个问题上,猫鼬函数- Model.findById()似乎无法通过_id属性找到数据库中明确存在的对象。流程如下(您可以在这里亲眼看到-- http://hackabox-eamonbenproject.rhcloud.com --我的项目):

当我试图在页面上加载一个帖子时,您可以查看发生的所有post info...the GET请求,这里的express调用了一个路由:

代码语言:javascript
复制
app.get('/api/posts/:id', api.showinfo);

这个api.showinfo函数目前是这样的(尽管我尝试了许多不同的东西):

代码语言:javascript
复制
exports.showinfo = function(req, res, next) {
  var postId = req.params.id;

  Post.findById(postId, function (err, post) {
    console.log("what did u find?" + post);
    res.send({ postinfo: post.postinfo });
    //res.json(post);
  });
};

console.log("what did u find?" + post)输出null,这意味着猫鼬的findById函数出错了。

我已登录以确保postId是正确的id...so,这不是问题所在。我还试着把res.send({ postinfo: post.postinfo });改成res.json(post)res.send(post.postinfo)res.send({ profile: post.postinfo }) --没有运气。

有人知道为什么findById可能找不到anything...the post.postinfo引用我的猫鼬虚拟模式,如下所示:

代码语言:javascript
复制
PostSchema
  .virtual('postinfo')
    .get(function() {
      return {
        '_id': this._id,
        'posttitle': this.posttitle,
        'content': this.content,
        'username': this.username,
        'date': this.date
      };
    });

我认为与res.send一起使用它是如何在我的种子中的用户/系统中使用的--就像这样使用它--而且它工作得很好:

代码语言:javascript
复制
exports.show = function (req, res, next) {
  var userId = req.params.id;

  User.findById(userId, function (err, user) {
    if (err) return next(err);
    if (!user) return res.send(404);

    res.send({ profile: user.profile });
  });
};

由于某些原因,当我将它与我创建的Post模型一起使用时,它不想在Openshift上工作,我很确定它在本地工作。

有什么想法吗?

更新

在将我的MongoDB版本在本地降级为2.4.6 (与openshift服务器版本相同)之后--该站点在本地开始出现与server...so相同的问题--这肯定是一个环境问题--我猜一些依赖Mongo的包也需要修改它们的版本--所以我将尝试这样做,看看这是否有帮助。当我现在在本地运行种子时,它似乎是种子内部冲突版本的一个问题-以下是来自我的package.json文件的所有与mongo相关的npm包:

代码语言:javascript
复制
{
  "name": "hackabox",
  "version": "0.0.0",
  "dependencies": {

    ...

    "mongoose": "~3.8.8",
    "connect-mongo": "mrzepinski/connect-mongo#2135988",

    ...
  },

  ...

}

有人知道MongoDB版本2.4.6要使用什么版本吗?

更新

我尝试了Mongoose v3.5.0,但是它不起作用--我正在查看提交日期,似乎大约在MongoDB版本2.4.6发布的时候。还有哪些软件包需要更新/降级才能与openshift服务器同步?

更新

做了一些没有运气的事情--但最终我进入了openshift服务器并运行了:

代码语言:javascript
复制
npm list -g --depth=0

它以一个EACCES错误作为响应--但无论如何它也发出了所有的版本号--所以它们如下:

代码语言:javascript
复制
glob error { [Error: EACCES, readdir '/opt/rh/nodejs010/root/usr/lib/node_modules/npm/man']
  errno: 3,
  code: 'EACCES',
  path: '/opt/rh/nodejs010/root/usr/lib/node_modules/npm/man' }
/opt/rh/nodejs010/root/usr/lib
├── abbrev@1.0.4
├── ansi@0.2.1
├── ansicolors@0.3.2
├── ansistyles@0.1.3
├── archy@0.0.2
├── asn1@0.1.11
├── assert-plus@0.1.4
├── async@0.2.9
├── aws-sign@0.3.0
├── bignumber.js@1.1.1
├── block-stream@0.0.7
├── boom@0.4.2
├── bson@0.2.3
├── buffer-crc32@0.2.1
├── bytes@0.2.1
├── child-process-close@0.1.1
├── chmodr@0.1.0
├── chownr@0.0.1
├── cmd-shim@1.1.0
├── colors@0.6.2
├── columnify@0.1.2
├── combined-stream@0.0.4
├── commander@1.1.1
├── config-chain@1.1.8
├── connect@2.7.10
├── cookie@0.1.0
├── cookie-jar@0.3.0
├── cookie-signature@1.0.1
├── couch-login@0.1.18
├── cryptiles@0.2.2
├── ctype@0.5.3
├── debug@0.7.2
├── delayed-stream@0.0.5
├── editor@0.0.5
├── express@3.2.5
├── forever-agent@0.5.0
├── form-data@0.1.1
├── formidable@1.0.14
├── fresh@0.2.0
├── fstream@0.1.25
├── fstream-ignore@0.0.7
├── fstream-npm@0.1.6
├── generic-pool@2.0.3
├── github-url-from-git@1.1.1
├── github-url-from-username-repo@0.0.2
├── glob@3.2.8
├── graceful-fs@2.0.0
├── hawk@1.0.0
├── hoek@0.9.1
├── http-signature@0.10.0
├── inherits@2.0.0
├── ini@1.1.0
├── init-package-json@0.0.14
├── json-stringify-safe@5.0.0
├── keypress@0.2.1
├── lockfile@0.4.2
├── lru-cache@2.5.0
├── methods@0.0.1
├── mime@1.2.11
├── minimatch@0.2.14
├── mkdirp@0.3.5
├── mongodb@1.3.19
├── mute-stream@0.0.4
├── mysql@2.0.0-alpha9
├── nan@0.4.4
├── node-gyp@0.12.2
├── node-static@0.6.9
├── node-uuid@1.4.1
├── nopt@2.1.2
├── normalize-package-data@0.2.8
├── npm@*
├── npm-registry-client@0.3.3
├── npm-user-validate@0.0.3
├── npmconf@0.1.12
├── npmlog@0.0.6
├── oauth-sign@0.3.0
├── once@1.3.0
├── opener@1.3.0
├── openshift-node-web-proxy@*
├── optimist@0.4.0
├── options@0.0.5
├── osenv@0.0.3
├── path-is-inside@1.0.0
├── pause@0.0.1
├── pg@0.12.3
├── promzard@0.2.0
├── proto-list@1.2.2
├── qs@0.6.5
├── range-parser@0.0.4
├── read@1.0.5
├── read-installed@0.2.4
├── read-package-json@1.1.6
├── request@2.25.0
├── require-all@0.0.8
├── retry@0.6.0
├── rimraf@2.2.6
├── semver@2.1.0
├── send@0.1.4
├── sha@1.2.1
├── sigmund@1.0.0
├── slide@1.1.5
├── sntp@0.2.4
├── supervisor@0.5.2
├── tar@0.1.19
├── text-table@0.2.0
├── tinycolor@0.0.1
├── tunnel-agent@0.3.0
├── uid-number@0.0.3
├── which@1.0.5
├── wordwrap@0.0.2
└── ws@0.4.25

我真的需要让我所有的全球npm包与openshift上的软件包相同,以确保它的工作(对于那些相关的软件包)吗?

我在本地运行了npm list -g --这就是我得到的:

代码语言:javascript
复制
/usr/lib
├─┬ bower@1.3.3
│ ├── abbrev@1.0.5
│ ├── archy@0.0.2
│ ├─┬ bower-config@0.5.0
│ │ ├── mout@0.6.0
│ │ └─┬ optimist@0.6.1
│ │   ├── minimist@0.0.8
│ │   └── wordwrap@0.0.2
│ ├── bower-endpoint-parser@0.2.1
│ ├─┬ bower-json@0.4.0
│ │ ├── deep-extend@0.2.8
│ │ └── intersect@0.0.3
│ ├── bower-logger@0.2.2
│ ├─┬ bower-registry-client@0.2.0
│ │ ├── async@0.2.10
│ │ ├─┬ bower-config@0.4.5
│ │ │ ├── mout@0.6.0
│ │ │ └─┬ optimist@0.6.1
│ │ │   ├── minimist@0.0.8
│ │ │   └── wordwrap@0.0.2
│ │ ├── lru-cache@2.3.1
│ │ ├─┬ request@2.27.0
│ │ │ ├── aws-sign@0.3.0
│ │ │ ├── cookie-jar@0.3.0
│ │ │ ├── forever-agent@0.5.2
│ │ │ ├─┬ form-data@0.1.2
│ │ │ │ └─┬ combined-stream@0.0.4
│ │ │ │   └── delayed-stream@0.0.5
│ │ │ ├─┬ hawk@1.0.0
│ │ │ │ ├── boom@0.4.2
│ │ │ │ ├── cryptiles@0.2.2
│ │ │ │ ├── hoek@0.9.1
│ │ │ │ └── sntp@0.2.4
│ │ │ ├─┬ http-signature@0.10.0
│ │ │ │ ├── asn1@0.1.11
│ │ │ │ ├── assert-plus@0.1.2
│ │ │ │ └── ctype@0.5.2
│ │ │ ├── json-stringify-safe@5.0.0
│ │ │ ├── mime@1.2.11
│ │ │ ├── node-uuid@1.4.1
│ │ │ ├── oauth-sign@0.3.0
│ │ │ ├── qs@0.6.6
│ │ │ └── tunnel-agent@0.3.0
│ │ └── request-replay@0.2.0
│ ├─┬ cardinal@0.4.4
│ │ ├── ansicolors@0.2.1
│ │ └─┬ redeyed@0.4.4
│ │   └── esprima@1.0.4
│ ├─┬ chalk@0.4.0
│ │ ├── ansi-styles@1.0.0
│ │ ├── has-color@0.1.7
│ │ └── strip-ansi@0.1.1
│ ├── chmodr@0.1.0
│ ├─┬ decompress-zip@0.0.6
│ │ ├─┬ binary@0.3.0
│ │ │ ├── buffers@0.1.1
│ │ │ └─┬ chainsaw@0.1.0
│ │ │   └── traverse@0.3.9
│ │ ├── mkpath@0.1.0
│ │ ├─┬ readable-stream@1.1.13-1
│ │ │ ├── core-util-is@1.0.1
│ │ │ ├── inherits@2.0.1
│ │ │ ├── isarray@0.0.1
│ │ │ └── string_decoder@0.10.25-1
│ │ └─┬ touch@0.0.2
│ │   └── nopt@1.0.10
│ ├─┬ fstream@0.1.25
│ │ └── inherits@2.0.1
│ ├─┬ fstream-ignore@0.0.7
│ │ ├── inherits@2.0.1
│ │ └─┬ minimatch@0.2.14
│ │   └── sigmund@1.0.0
│ ├─┬ glob@3.2.9
│ │ ├── inherits@2.0.1
│ │ └─┬ minimatch@0.2.14
│ │   └── sigmund@1.0.0
│ ├── graceful-fs@2.0.3
│ ├─┬ handlebars@1.3.0
│ │ ├─┬ optimist@0.3.7
│ │ │ └── wordwrap@0.0.2
│ │ └─┬ uglify-js@2.3.6
│ │   ├── async@0.2.10
│ │   └─┬ source-map@0.1.33
│ │     └── amdefine@0.1.0
│ ├─┬ inquirer@0.4.1
│ │ ├── async@0.2.10
│ │ ├─┬ cli-color@0.2.3
│ │ │ ├── es5-ext@0.9.2
│ │ │ └─┬ memoizee@0.2.6
│ │ │   ├── event-emitter@0.2.2
│ │ │   └── next-tick@0.1.0
│ │ ├── lodash@2.4.1
│ │ ├── mute-stream@0.0.4
│ │ ├── readline2@0.1.0
│ │ └── through@2.3.4
│ ├─┬ insight@0.3.1
│ │ ├── async@0.2.10
│ │ ├─┬ configstore@0.2.3
│ │ │ ├─┬ js-yaml@3.0.2
│ │ │ │ ├─┬ argparse@0.1.15
│ │ │ │ │ ├── underscore@1.4.4
│ │ │ │ │ └── underscore.string@2.3.3
│ │ │ │ └── esprima@1.0.4
│ │ │ └── uuid@1.4.1
│ │ ├─┬ lodash.debounce@2.4.1
│ │ │ ├── lodash.isfunction@2.4.1
│ │ │ ├─┬ lodash.isobject@2.4.1
│ │ │ │ └── lodash._objecttypes@2.4.1
│ │ │ └─┬ lodash.now@2.4.1
│ │ │   └── lodash._isnative@2.4.1
│ │ ├── object-assign@0.1.2
│ │ └─┬ request@2.27.0
│ │   ├── aws-sign@0.3.0
│ │   ├── cookie-jar@0.3.0
│ │   ├── forever-agent@0.5.2
│ │   ├─┬ form-data@0.1.2
│ │   │ └─┬ combined-stream@0.0.4
│ │   │   └── delayed-stream@0.0.5
│ │   ├─┬ hawk@1.0.0
│ │   │ ├── boom@0.4.2
│ │   │ ├── cryptiles@0.2.2
│ │   │ ├── hoek@0.9.1
│ │   │ └── sntp@0.2.4
│ │   ├─┬ http-signature@0.10.0
│ │   │ ├── asn1@0.1.11
│ │   │ ├── assert-plus@0.1.2
│ │   │ └── ctype@0.5.2
│ │   ├── json-stringify-safe@5.0.0
│ │   ├── mime@1.2.11
│ │   ├── node-uuid@1.4.1
│ │   ├── oauth-sign@0.3.0
│ │   ├── qs@0.6.6
│ │   └── tunnel-agent@0.3.0
│ ├── is-root@0.1.0
│ ├── junk@0.3.0
│ ├── lockfile@0.4.2
│ ├── lru-cache@2.5.0
│ ├── mkdirp@0.3.5
│ ├── mout@0.9.1
│ ├── nopt@2.2.0
│ ├── opn@0.1.1
│ ├── osenv@0.0.3
│ ├─┬ p-throttler@0.0.1
│ │ └── q@0.9.7
│ ├─┬ promptly@0.2.0
│ │ └─┬ read@1.0.5
│ │   └── mute-stream@0.0.4
│ ├── q@1.0.1
│ ├─┬ request@2.34.0
│ │ ├── aws-sign2@0.5.0
│ │ ├── forever-agent@0.5.2
│ │ ├─┬ form-data@0.1.2
│ │ │ ├── async@0.2.10
│ │ │ └─┬ combined-stream@0.0.4
│ │ │   └── delayed-stream@0.0.5
│ │ ├─┬ hawk@1.0.0
│ │ │ ├── boom@0.4.2
│ │ │ ├── cryptiles@0.2.2
│ │ │ ├── hoek@0.9.1
│ │ │ └── sntp@0.2.4
│ │ ├─┬ http-signature@0.10.0
│ │ │ ├── asn1@0.1.11
│ │ │ ├── assert-plus@0.1.2
│ │ │ └── ctype@0.5.2
│ │ ├── json-stringify-safe@5.0.0
│ │ ├── mime@1.2.11
│ │ ├── node-uuid@1.4.1
│ │ ├── oauth-sign@0.3.0
│ │ ├── qs@0.6.6
│ │ ├─┬ tough-cookie@0.12.1
│ │ │ └── punycode@1.2.4
│ │ └── tunnel-agent@0.3.0
│ ├─┬ request-progress@0.3.1
│ │ └── throttleit@0.0.2
│ ├── retry@0.6.0
│ ├── rimraf@2.2.6
│ ├── semver@2.2.1
│ ├─┬ shell-quote@1.4.1
│ │ ├── array-filter@0.0.1
│ │ ├── array-map@0.0.0
│ │ ├── array-reduce@0.0.0
│ │ └── jsonify@0.0.0
│ ├── stringify-object@0.2.0
│ ├─┬ tar@0.1.19
│ │ ├── block-stream@0.0.7
│ │ └── inherits@2.0.1
│ ├── tmp@0.0.23
│ ├─┬ update-notifier@0.1.8
│ │ ├─┬ configstore@0.2.3
│ │ │ ├─┬ js-yaml@3.0.2
│ │ │ │ ├─┬ argparse@0.1.15
│ │ │ │ │ ├── underscore@1.4.4
│ │ │ │ │ └── underscore.string@2.3.3
│ │ │ │ └── esprima@1.0.4
│ │ │ ├── object-assign@0.1.2
│ │ │ └── uuid@1.4.1
│ │ ├─┬ request@2.27.0
│ │ │ ├── aws-sign@0.3.0
│ │ │ ├── cookie-jar@0.3.0
│ │ │ ├── forever-agent@0.5.2
│ │ │ ├─┬ form-data@0.1.2
│ │ │ │ ├── async@0.2.10
│ │ │ │ └─┬ combined-stream@0.0.4
│ │ │ │   └── delayed-stream@0.0.5
│ │ │ ├─┬ hawk@1.0.0
│ │ │ │ ├── boom@0.4.2
│ │ │ │ ├── cryptiles@0.2.2
│ │ │ │ ├── hoek@0.9.1
│ │ │ │ └── sntp@0.2.4
│ │ │ ├─┬ http-signature@0.10.0
│ │ │ │ ├── asn1@0.1.11
│ │ │ │ ├── assert-plus@0.1.2
│ │ │ │ └── ctype@0.5.2
│ │ │ ├── json-stringify-safe@5.0.0
│ │ │ ├── mime@1.2.11
│ │ │ ├── node-uuid@1.4.1
│ │ │ ├── oauth-sign@0.3.0
│ │ │ ├── qs@0.6.6
│ │ │ └── tunnel-agent@0.3.0
│ │ └── semver@2.1.0
│ └── which@1.0.5
├─┬ express@3.2.5
│ ├── buffer-crc32@0.2.1
│ ├── commander@0.6.1
│ ├─┬ connect@2.7.10
│ │ ├── bytes@0.2.0
│ │ ├── cookie@0.0.5
│ │ ├── formidable@1.0.14
│ │ ├── pause@0.0.1
│ │ └── qs@0.6.5
│ ├── cookie@0.1.0
│ ├── cookie-signature@1.0.1
│ ├─┬ debug@1.0.4
│ │ └── ms@0.6.2
│ ├── fresh@0.1.0
│ ├── methods@0.0.1
│ ├── mkdirp@0.3.4
│ ├── range-parser@0.0.4
│ └─┬ send@0.1.0
│   └── mime@1.2.6
├─┬ express-generator@4.2.0
│ ├─┬ commander@1.3.2
│ │ └── keypress@0.1.0
│ └── mkdirp@0.3.5
├─┬ generator-angular@0.8.0
│ ├─┬ chalk@0.4.0
│ │ ├── ansi-styles@1.0.0
│ │ ├── has-color@0.1.7
│ │ └── strip-ansi@0.1.1
│ ├─┬ wiredep@1.0.0
│ │ ├─┬ chalk@0.1.1
│ │ │ ├── ansi-styles@0.1.2
│ │ │ └── has-color@0.1.7
│ │ ├─┬ glob@3.2.11
│ │ │ ├── inherits@2.0.1
│ │ │ └─┬ minimatch@0.3.0
│ │ │   ├── lru-cache@2.5.0
│ │ │   └── sigmund@1.0.0
│ │ └── lodash@1.3.1
│ └─┬ yeoman-generator@0.16.0
│   ├── async@0.2.10
│   ├─┬ cheerio@0.13.1
│   │ ├─┬ CSSselect@0.4.1
│   │ │ ├── CSSwhat@0.4.7
│   │ │ └─┬ domutils@1.4.3
│   │ │   └── domelementtype@1.1.1
│   │ ├── entities@0.5.0
│   │ ├─┬ htmlparser2@3.4.0
│   │ │ ├── domelementtype@1.1.1
│   │ │ ├── domhandler@2.2.0
│   │ │ ├── domutils@1.3.0
│   │ │ └─┬ readable-stream@1.1.13-1
│   │ │   ├── core-util-is@1.0.1
│   │ │   ├── inherits@2.0.1
│   │ │   ├── isarray@0.0.1
│   │ │   └── string_decoder@0.10.25-1
│   │ └── underscore@1.5.2
│   ├── class-extend@0.1.1
│   ├── dargs@0.1.0
│   ├── debug@0.7.4
│   ├── diff@1.0.8
│   ├─┬ download@0.1.17
│   │ ├─┬ decompress@0.2.3
│   │ │ ├── adm-zip@0.4.4
│   │ │ ├─┬ extname@0.1.2
│   │ │ │ └── ext-list@0.1.0
│   │ │ ├── map-key@0.1.4
│   │ │ ├─┬ stream-combiner@0.0.4
│   │ │ │ └── duplexer@0.1.1
│   │ │ ├─┬ tar@0.1.19
│   │ │ │ ├── block-stream@0.0.7
│   │ │ │ ├─┬ fstream@0.1.25
│   │ │ │ │ └── graceful-fs@2.0.3
│   │ │ │ └── inherits@2.0.1
│   │ │ └─┬ tempfile@0.1.3
│   │ │   └── uuid@1.4.1
│   │ ├── each-async@0.1.3
│   │ ├── get-stdin@0.1.0
│   │ ├── get-urls@0.1.2
│   │ ├─┬ nopt@2.2.1
│   │ │ └── abbrev@1.0.5
│   │ ├─┬ request@2.36.0
│   │ │ ├── aws-sign2@0.5.0
│   │ │ ├── forever-agent@0.5.2
│   │ │ ├─┬ form-data@0.1.2
│   │ │ │ └─┬ combined-stream@0.0.4
│   │ │ │   └── delayed-stream@0.0.5
│   │ │ ├─┬ hawk@1.0.0
│   │ │ │ ├── boom@0.4.2
│   │ │ │ ├── cryptiles@0.2.2
│   │ │ │ ├── hoek@0.9.1
│   │ │ │ └── sntp@0.2.4
│   │ │ ├─┬ http-signature@0.10.0
│   │ │ │ ├── asn1@0.1.11
│   │ │ │ ├── assert-plus@0.1.2
│   │ │ │ └── ctype@0.5.2
│   │ │ ├── json-stringify-safe@5.0.0
│   │ │ ├── node-uuid@1.4.1
│   │ │ ├── oauth-sign@0.3.0
│   │ │ ├── qs@0.6.6
│   │ │ ├─┬ tough-cookie@0.12.1
│   │ │ │ └── punycode@1.2.4
│   │ │ └── tunnel-agent@0.4.0
│   │ └─┬ through2@0.4.2
│   │   ├─┬ readable-stream@1.0.27-1
│   │   │ ├── core-util-is@1.0.1
│   │   │ ├── inherits@2.0.1
│   │   │ ├── isarray@0.0.1
│   │   │ └── string_decoder@0.10.25-1
│   │   └─┬ xtend@2.1.2
│   │     └── object-keys@0.4.0
│   ├─┬ file-utils@0.1.5
│   │ ├── isbinaryfile@0.1.9
│   │ ├── lodash@2.1.0
│   │ └─┬ minimatch@0.2.14
│   │   ├── lru-cache@2.5.0
│   │   └── sigmund@1.0.0
│   ├── findup-sync@0.1.3
│   ├─┬ glob@3.2.11
│   │ ├── inherits@2.0.1
│   │ └─┬ minimatch@0.3.0
│   │   ├── lru-cache@2.5.0
│   │   └── sigmund@1.0.0
│   ├── iconv-lite@0.2.11
│   ├─┬ inquirer@0.4.1
│   │ ├─┬ cli-color@0.2.3
│   │ │ ├── es5-ext@0.9.2
│   │ │ └─┬ memoizee@0.2.6
│   │ │   ├── event-emitter@0.2.2
│   │ │   └── next-tick@0.1.0
│   │ ├── mute-stream@0.0.4
│   │ ├── readline2@0.1.0
│   │ └── through@2.3.4
│   ├── isbinaryfile@2.0.1
│   ├── lodash@2.4.1
│   ├── mime@1.2.11
│   ├── mkdirp@0.3.5
│   ├─┬ request@2.30.0
│   │ ├── aws-sign2@0.5.0
│   │ ├── forever-agent@0.5.2
│   │ ├─┬ form-data@0.1.2
│   │ │ └─┬ combined-stream@0.0.4
│   │ │   └── delayed-stream@0.0.5
│   │ ├─┬ hawk@1.0.0
│   │ │ ├── boom@0.4.2
│   │ │ ├── cryptiles@0.2.2
│   │ │ ├── hoek@0.9.1
│   │ │ └── sntp@0.2.4
│   │ ├─┬ http-signature@0.10.0
│   │ │ ├── asn1@0.1.11
│   │ │ ├── assert-plus@0.1.2
│   │ │ └── ctype@0.5.2
│   │ ├── json-stringify-safe@5.0.0
│   │ ├── node-uuid@1.4.1
│   │ ├── oauth-sign@0.3.0
│   │ ├── qs@0.6.6
│   │ ├─┬ tough-cookie@0.9.15
│   │ │ └── punycode@1.2.4
│   │ └── tunnel-agent@0.3.0
│   ├── rimraf@2.2.8
│   ├── shelljs@0.2.6
│   ├── text-table@0.2.0
│   └── underscore.string@2.3.3
├─┬ generator-angular-fullstack@1.4.2
│ ├─┬ chalk@0.4.0
│ │ ├── ansi-styles@1.0.0
│ │ ├── has-color@0.1.7
│ │ └── strip-ansi@0.1.1
│ ├─┬ wiredep@0.4.2
│ │ ├─┬ chalk@0.1.1
│ │ │ ├── ansi-styles@0.1.2
│ │ │ └── has-color@0.1.7
│ │ └── lodash@1.3.1
│ └─┬ yeoman-generator@0.16.0
│   ├── async@0.2.10
│   ├─┬ cheerio@0.13.1
│   │ ├─┬ CSSselect@0.4.1
│   │ │ ├── CSSwhat@0.4.5
│   │ │ └─┬ domutils@1.4.3
│   │ │   └── domelementtype@1.1.1
│   │ ├── entities@0.5.0
│   │ ├─┬ htmlparser2@3.4.0
│   │ │ ├── domelementtype@1.1.1
│   │ │ ├── domhandler@2.2.0
│   │ │ ├── domutils@1.3.0
│   │ │ └─┬ readable-stream@1.1.13-1
│   │ │   ├── core-util-is@1.0.1
│   │ │   ├── inherits@2.0.1
│   │ │   ├── isarray@0.0.1
│   │ │   └── string_decoder@0.10.25-1
│   │ └── underscore@1.5.2
│   ├── class-extend@0.1.1
│   ├── dargs@0.1.0
│   ├── debug@0.7.4
│   ├── diff@1.0.8
│   ├─┬ download@0.1.16
│   │ ├─┬ decompress@0.2.3
│   │ │ ├── adm-zip@0.4.4
│   │ │ ├─┬ extname@0.1.2
│   │ │ │ └── ext-list@0.1.0
│   │ │ ├─┬ map-key@0.1.1
│   │ │ │ └── mout@0.9.1
│   │ │ ├─┬ stream-combiner@0.0.4
│   │ │ │ └── duplexer@0.1.1
│   │ │ ├─┬ tar@0.1.19
│   │ │ │ ├── block-stream@0.0.7
│   │ │ │ ├─┬ fstream@0.1.25
│   │ │ │ │ └── graceful-fs@2.0.3
│   │ │ │ └── inherits@2.0.1
│   │ │ └─┬ tempfile@0.1.3
│   │ │   └── uuid@1.4.1
│   │ ├── each-async@0.1.2
│   │ ├── get-stdin@0.1.0
│   │ ├── get-urls@0.1.1
│   │ ├─┬ nopt@2.2.0
│   │ │ └── abbrev@1.0.5
│   │ ├─┬ request@2.34.0
│   │ │ ├── aws-sign2@0.5.0
│   │ │ ├── forever-agent@0.5.2
│   │ │ ├─┬ form-data@0.1.2
│   │ │ │ └─┬ combined-stream@0.0.4
│   │ │ │   └── delayed-stream@0.0.5
│   │ │ ├─┬ hawk@1.0.0
│   │ │ │ ├── boom@0.4.2
│   │ │ │ ├── cryptiles@0.2.2
│   │ │ │ ├── hoek@0.9.1
│   │ │ │ └── sntp@0.2.4
│   │ │ ├─┬ http-signature@0.10.0
│   │ │ │ ├── asn1@0.1.11
│   │ │ │ ├── assert-plus@0.1.2
│   │ │ │ └── ctype@0.5.2
│   │ │ ├── json-stringify-safe@5.0.0
│   │ │ ├── node-uuid@1.4.1
│   │ │ ├── oauth-sign@0.3.0
│   │ │ ├── qs@0.6.6
│   │ │ ├─┬ tough-cookie@0.12.1
│   │ │ │ └── punycode@1.2.4
│   │ │ └── tunnel-agent@0.3.0
│   │ └─┬ through2@0.4.1
│   │   ├─┬ readable-stream@1.0.27-1
│   │   │ ├── core-util-is@1.0.1
│   │   │ ├── inherits@2.0.1
│   │   │ ├── isarray@0.0.1
│   │   │ └── string_decoder@0.10.25-1
│   │   └─┬ xtend@2.1.2
│   │     └── object-keys@0.4.0
│   ├─┬ file-utils@0.1.5
│   │ ├── isbinaryfile@0.1.9
│   │ ├── lodash@2.1.0
│   │ └─┬ minimatch@0.2.14
│   │   ├── lru-cache@2.5.0
│   │   └── sigmund@1.0.0
│   ├── findup-sync@0.1.3
│   ├─┬ glob@3.2.9
│   │ ├── inherits@2.0.1
│   │ └─┬ minimatch@0.2.14
│   │   ├── lru-cache@2.5.0
│   │   └── sigmund@1.0.0
│   ├── iconv-lite@0.2.11
│   ├─┬ inquirer@0.4.1
│   │ ├─┬ cli-color@0.2.3
│   │ │ ├── es5-ext@0.9.2
│   │ │ └─┬ memoizee@0.2.6
│   │ │   ├── event-emitter@0.2.2
│   │ │   └── next-tick@0.1.0
│   │ ├── mute-stream@0.0.4
│   │ ├── readline2@0.1.0
│   │ └── through@2.3.4
│   ├── isbinaryfile@2.0.1
│   ├── lodash@2.4.1
│   ├── mime@1.2.11
│   ├── mkdirp@0.3.5

...

不可能把它全部发出去--这个问题已经很久了,哈哈。

因此,我想我可以通过,并确保他们都是same...but,有谁知道哪一个将是最重要的问题,我有?

天哪,那太烦人了!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-21 20:05:29

几天来,我一直致力于让我的网站在openshift上工作。我花了一两天时间确保我在计算机上使用的所有npm包版本都与openshift上使用的版本相同。在我对所有版本进行同步之后,重新分析我的代码需要做大量的工作,但我最终还是让它工作起来了。

我必须指出的主要错误是,当我试图执行PUT请求时,即使我没有更改_id字段,它也会给我带来这个错误:

代码语言:javascript
复制
MongoError: Mod on _id not allowed

我最终意识到,我需要创建一个包含所有相同信息的对象,只需不使用_id字段就可以使更新正常工作。

除此之外,它只是做了大量的修补工作--这是我努力工作的结果-- http://hackabox-eamonbenproject.rhcloud.com/ --这是我所做的与论坛相关的问题,所以请看一下--它是完全起作用的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24847384

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档