【问题标题】:Weird requests duplication in Mean.ioMean.io 中的奇怪请求重复
【发布时间】:2015-07-06 17:38:11
【问题描述】:

我从 Github 克隆了一个在其他计算机(MacOS X 和 Windows)上完美运行的存储库,但由于某种原因我无法登录。它是一个基础 Mean.io 项目。它加载完美。我注册正常,但是当我尝试登录时,它会将我重定向到 /。用户正确存储在 mongo 中,所以我不知道/理解发生了什么。我也用 node-inspector 调试过,但没有得到任何结果。

我从调试中发现,在我的计算机中,这部分的代码行为错误(packages/users/public/controllers/meanUser.js):

// authentication OK
$scope.loginError = 0;
$rootScope.user = response.user; // here $scope.global.authenticated is false
$rootScope.$emit('loggedin');    // $scope.global.authenticated is set to true
if (response.redirect) { // here $scope.global.authenticated is false again and it shouldn't but haven't been able to find out what's the problem

这是我的 package.json

"name": "mean",
  "description": "MEAN.io: A fullstack JavaScript framework powered by MongoDB, ExpressJS, AngularJS, NodeJS.",
  "version": "0.4.3",
  "private": false,
  "author": "Linnovate <mean@linnovate.net>",
  "contributors": "https://github.com/linnovate/mean/graphs/contributors",
  "mean": "0.4.3",
  "repository": {
    "type": "git",
    "url": "https://github.com/linnovate/mean.git"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.3.x"
  },
  "scripts": {
    "start": "node server",
    "mocha": "node node_modules/.bin/mocha packages/**/server/tests/**/*.js -R spec -r tools/test/mocha-req.js",
    "karma": "node node_modules/karma/bin/karma start",
    "test": "grunt test",
    "postinstall": "node node_modules/meanio/node_modules/mean-cli/bin/mean-postinstall"
  },

我有节点:0.10.33 平均值:0.4.3 平均cli:0.9.14 蒙哥:2.6.5

这是我的节点日志,其中重复请求非常奇怪。

我的网络标签

Chrome:(工作和不工作)

Firefox:(工作和不工作)

任何帮助将不胜感激。

编辑

我已将 node、npm、mean、bower 和 gulp 更新到最新版本,尽管我收到此错误:

[Error: Module did not self-register.]
js-bson: Failed to load c++ bson extension, using pure JS version
Mean app started on port 3000 (development) cluster.worker.id: 0

情况有所改善:现在只发出一次请求

【问题讨论】:

  • 你的网络标签说什么?
  • 我已经编辑了帖子,添加了测试工作(同事笔记本电脑)和不工作(我的笔记本电脑)的屏幕截图

标签: javascript angularjs node.js mongodb mean.io


【解决方案1】:

最终,我意识到 sudo npm install 出错了,但我仍然不知道为什么。所以,我的解决方案是从我的合作伙伴那里复制一个文件夹并使用它。

不过,我必须深入检查 node 和 npm 安装。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-04
    • 1970-01-01
    • 1970-01-01
    • 2013-06-24
    • 1970-01-01
    • 2017-09-01
    • 2020-03-02
    • 1970-01-01
    相关资源
    最近更新 更多