gpt4 book ai didi

javascript - Mean.io 中奇怪的请求重复

转载 作者:太空宇宙 更新时间:2023-11-03 22:34:45 26 4
gpt4 key购买 nike

我已经从 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"
},

我的 Node :0.10.33 平均值:0.4.3 平均气候:0.9.14 蒙戈:2.6.5

这是我的 Node 日志,非常奇怪的是请求是重复的。

It is very strange that requests are duplicated

我的网络选项卡

Chrome:(工作和不工作) enter image description here

Firefox:(工作和不工作) enter image description here

任何帮助将不胜感激。

编辑:

我已将 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

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

最佳答案

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

尽管如此,我必须深入检查 Node 和 npm 安装。

关于javascript - Mean.io 中奇怪的请求重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31140441/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com