gpt4 book ai didi

javascript - 仅用两行代码无法启动 meteor 项目

转载 作者:行者123 更新时间:2023-12-02 16:17:07 25 4
gpt4 key购买 nike

我正在尝试学习 meteor 并浏览 meteor 提示,以及js文件中的第二行“PlayersList = new Mongo.Collection('players');”导致其无法运行。它说我在子​​目录中有一个重复的文件,但我不确定这是怎么可能的,因为我在那里只有三个文件:leaderboard.css、leaderboard.html 和leaderboard.js。

我不确定如何格式化以使其更具可读性,感谢您的帮助!

这是日志:

C:\Users\jeffr_000\Documents\leaderboard>meteor
[[[[[ C:\Users\jeffr_000\Documents\leaderboard ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Exited with code: 8
W20150406-12:20:14.063(-7)? (STDERR)
W20150406-12:20:14.065(-7)? (STDERR) C:\Users\jeffr_000\AppData\Local\.meteor\pa
ckages\meteor-tool\1.1.3\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules
\fibers\future.js:245
W20150406-12:20:14.065(-7)? (STDERR)
throw(ex);
W20150406-12:20:14.066(-7)? (STDERR)
^
W20150406-12:20:14.066(-7)? (STDERR) Error: A method named '/member/insert' is a
lready defined
W20150406-12:20:14.066(-7)? (STDERR) at packages/ddp/livedata_server.js:1461
:1
W20150406-12:20:14.066(-7)? (STDERR) at Function._.each._.forEach (packages/
underscore/underscore.js:113:1)
W20150406-12:20:14.066(-7)? (STDERR) at [object Object]._.extend.methods (pa
ckages/ddp/livedata_server.js:1459:1)
W20150406-12:20:14.067(-7)? (STDERR) at [object Object].Mongo.Collection._de
fineMutationMethods (packages/mongo/collection.js:904:1)
W20150406-12:20:14.067(-7)? (STDERR) at new Mongo.Collection (packages/mongo
/collection.js:209:1)
W20150406-12:20:14.067(-7)? (STDERR) at app\leaderboard.js:3:14
W20150406-12:20:14.067(-7)? (STDERR) at app\leaderboard.js:5:3
W20150406-12:20:14.068(-7)? (STDERR) at C:\Users\jeffr_000\Documents\leaderb
oard\.meteor\local\build\programs\server\boot.js:222:10
W20150406-12:20:14.068(-7)? (STDERR) at Array.forEach (native)
W20150406-12:20:14.068(-7)? (STDERR) at Function._.each._.forEach (C:\Users\
jeffr_000\AppData\Local\.meteor\packages\meteor-tool\1.1.3\mt-os.windows.x86_32\
dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
W20150406-12:20:20.151(-7)? (STDERR)
W20150406-12:20:20.151(-7)? (STDERR) C:\Users\jeffr_000\AppData\Local\.meteor\pa
ckages\meteor-tool\1.1.3\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules
\fibers\future.js:245
W20150406-12:20:20.152(-7)? (STDERR)
throw(ex);
W20150406-12:20:20.152(-7)? (STDERR)
^
W20150406-12:20:20.152(-7)? (STDERR) Error: A method named '/member/insert' is a
lready defined
W20150406-12:20:20.152(-7)? (STDERR) at packages/ddp/livedata_server.js:1461
:1
W20150406-12:20:20.153(-7)? (STDERR) at Function._.each._.forEach (packages/
underscore/underscore.js:113:1)
W20150406-12:20:20.153(-7)? (STDERR) at [object Object]._.extend.methods (pa
ckages/ddp/livedata_server.js:1459:1)
W20150406-12:20:20.153(-7)? (STDERR) at [object Object].Mongo.Collection._de
fineMutationMethods (packages/mongo/collection.js:904:1)
W20150406-12:20:20.154(-7)? (STDERR) at new Mongo.Collection (packages/mongo
/collection.js:209:1)
W20150406-12:20:20.154(-7)? (STDERR) at app\leaderboard.js:3:14
W20150406-12:20:20.154(-7)? (STDERR) at app\leaderboard.js:5:3
W20150406-12:20:20.155(-7)? (STDERR) at C:\Users\jeffr_000\Documents\leaderb
oard\.meteor\local\build\programs\server\boot.js:222:10
W20150406-12:20:20.155(-7)? (STDERR) at Array.forEach (native)
W20150406-12:20:20.155(-7)? (STDERR) at Function._.each._.forEach (C:\Users\
jeffr_000\AppData\Local\.meteor\packages\meteor-tool\1.1.3\mt-os.windows.x86_32\
dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
=> Exited with code: 8
W20150406-12:20:26.038(-7)? (STDERR)
W20150406-12:20:26.038(-7)? (STDERR) C:\Users\jeffr_000\AppData\Local\.meteor\pa
ckages\meteor-tool\1.1.3\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules
\fibers\future.js:245
W20150406-12:20:26.038(-7)? (STDERR)
throw(ex);
W20150406-12:20:26.038(-7)? (STDERR)
^
W20150406-12:20:26.038(-7)? (STDERR) Error: A method named '/member/insert' is a
lready defined
W20150406-12:20:26.039(-7)? (STDERR) at packages/ddp/livedata_server.js:1461
:1
W20150406-12:20:26.039(-7)? (STDERR) at Function._.each._.forEach (packages/
underscore/underscore.js:113:1)
W20150406-12:20:26.039(-7)? (STDERR) at [object Object]._.extend.methods (pa
ckages/ddp/livedata_server.js:1459:1)
W20150406-12:20:26.040(-7)? (STDERR) at [object Object].Mongo.Collection._de
fineMutationMethods (packages/mongo/collection.js:904:1)
W20150406-12:20:26.040(-7)? (STDERR) at new Mongo.Collection (packages/mongo
/collection.js:209:1)
W20150406-12:20:26.040(-7)? (STDERR) at app\leaderboard.js:3:14
W20150406-12:20:26.041(-7)? (STDERR) at app\leaderboard.js:5:3
W20150406-12:20:26.041(-7)? (STDERR) at C:\Users\jeffr_000\Documents\leaderb
oard\.meteor\local\build\programs\server\boot.js:222:10
W20150406-12:20:26.041(-7)? (STDERR) at Array.forEach (native)
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
W20150406-12:20:26.042(-7)? (STDERR) at Function._.each._.forEach (C:\Users\
jeffr_000\AppData\Local\.meteor\packages\meteor-tool\1.1.3\mt-os.windows.x86_32\
dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)

最佳答案

通常当您遇到类似名为“/member/insert”的方法是一个错误时
lready已定义
,这意味着您正在创建new Mongo.Collection('member')多次。

也许您正在 Array.forEach 函数中执行此操作(如果数组有超过 1 个元素,则该函数会调用多次)。

从您的错误日志来看,它似乎是由 server\boot.js< 的 _.each(array,fn) 中的 fn 引起的.

关于javascript - 仅用两行代码无法启动 meteor 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29478571/

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