我安装了最新的"望远镜"我的Windows 8环境中的Meteor 0.8.1.3项目(已安装在Windows中)。请注意,最新的"望远镜"该项目确实支持Meteor 0.8。
我确实克隆了其软件包的所有相关git存储库。
当我运行应用程序时(通过" meteor run")一切似乎都可以正常构建,但之后就开始了MongoDB"消息出现以下错误(并且每隔几秒重复一次):
=> Started proxy.
=> Started MongoDB.
W20140608-02:12:51.171(3)? (STDERR)
W20140608-02:12:51.172(3)? (STDERR)
C:\Users\nm2arch\AppData\Local\.meteor\tools\edf8981bb6\lib\node_modules\fibere.js:173
W20140608-02:12:51.173(3)? (STDERR) throw(ex);
W20140608-02:12:51.175(3)? (STDERR) ^
W20140608-02:12:51.176(3)? (STDERR) ReferenceError: window is not defined
W20140608-02:12:51.181(3)? (STDERR) at a.lang.months (packages/momentjs/moment\min\langs.min.js:1)
W20140608-02:12:51.182(3)? (STDERR) at moment (packages/momentjs/moment\min\langs.min.js:1)
W20140608-02:12:51.183(3)? (STDERR) at packages/momentjs.js:45:4
W20140608-02:12:51.184(3)? (STDERR) at packages/momentjs.js:73:3
W20140608-02:12:51.184(3)? (STDERR) at C:\work\telescope\.meteor\local\build\programs\server\boot.js:185
W20140608-02:12:51.185(3)? (STDERR) at Array.forEach (native)
W20140608-02:12:51.186(3)? (STDERR) at Function._.each._.forEach(C:\Users\nm2arch\AppData\Local\.meteor\tool81bb6\lib\node_modules\underscore\underscore.js:79:11)
W20140608-02:12:51.187(3)? (STDERR) at C:\work\telescope\.meteor\local\build\programs\server\boot.js:102
=> Exited with code: 8
=> Started proxy.
=> Started MongoDB.
W20140608-02:12:51.171(3)? (STDERR)
W20140608-02:12:51.172(3)? (STDERR)
C:\Users\nm2arch\AppData\Local\.meteor\tools\edf8981bb6\lib\node_modules\fibere.js:173
W20140608-02:12:51.173(3)? (STDERR) throw(ex);
W20140608-02:12:51.175(3)? (STDERR) ^
W20140608-02:12:51.176(3)? (STDERR) ReferenceError: window is not defined
W20140608-02:12:51.181(3)? (STDERR) at a.lang.months (packages/momentjs/moment\min\langs.min.js:1)
W20140608-02:12:51.182(3)? (STDERR) at moment (packages/momentjs/moment\min\langs.min.js:1)
W20140608-02:12:51.183(3)? (STDERR) at packages/momentjs.js:45:4
W20140608-02:12:51.184(3)? (STDERR) at packages/momentjs.js:73:3
W20140608-02:12:51.184(3)? (STDERR) at C:\work\telescope\.meteor\local\build\programs\server\boot.js:185
W20140608-02:12:51.185(3)? (STDERR) at Array.forEach (native)
W20140608-02:12:51.186(3)? (STDERR) at Function._.each._.forEach(C:\Users\nm2arch\AppData\Local\.meteor\tool81bb6\lib\node_modules\underscore\underscore.js:79:11)
W20140608-02:12:51.187(3)? (STDERR) at C:\work\telescope\.meteor\local\build\programs\server\boot.js:102
=> Exited with code: 8
(......以及上述模式重复多次......)
当然,没有任何事情发生在" localhost:3000",因为应用程序无法正常运行。
我无法弄清楚还有什么需要做的才能让某人在Windows环境中使用Meteor运行Telescope项目(截至2014年6月)。
我相信其他用户在使用Meteor项目和Windows时会遇到类似的问题(不一定完全相同),所以最好在这里找到解决方案(至少对于这些特殊问题)。
谢谢!
答案 0 :(得分:0)
该错误似乎非常具体地说是'窗口'在'时刻找不到变量'封装
此软件包用于显示和操作时间,通常用于浏览器端的“窗口”窗口'通常/始终存在。您的日志显示正在服务器端使用它。
我的猜测是你还没有克服包裹的正确性,因此你有一个版本的时刻没有被改编为流星。
我怀疑如果您使用相同的文件并在Linux或Mac上运行它们,您会得到完全相同的错误。
如果您详细说明了您克隆的存储库,我可能会发现问题。
更新 :作为参考,以下是我为使望远镜工作所做的工作。
首先,我将Telescope下载到子目录:
git clone https://github.com/TelescopeJS/Telescope.git
cd Telescope
接下来,我使用一个简单的Powershell脚本来自动化陨石的本质。 如果只有几个依赖项,你可以手动完成,但Telescope有一些:
powershell
$root = Get-Location
$json = Get-Content smart.lock | Out-String | ConvertFrom-Json
$names = $json.dependencies.packages | Get-Member -Type NoteProperty | Select -expand Name
foreach ($name in $names)
{
echo ('-' * 78)
echo "Installing package: $name"
$p = $json.dependencies.packages.$name
cd "$root\packages"
[Environment]::CurrentDirectory = Get-Location
echo "=> git clone --recursive $($p.git) $name"
git clone --recursive $($p.git) $name
cd "$root\packages\$name"
[Environment]::CurrentDirectory = Get-Location
echo "=> git checkout $($p.commit)"
git checkout $($p.commit)
}
然后我们需要将包添加到Meteor(仍然使用PowerShell语法):
cd $root
[Environment]::CurrentDirectory = Get-Location
echo "=> meteor add $names"
meteor add $names
最后我跑上了流星:
meteor
[[[[[ C:\meteor\Telescope ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
希望脚本可以帮助其他人。
更新2 :此版本的脚本将与PowerShell v2一起使用:
$root = Get-Location
$lock = "$(gc smart.lock)" -replace '[\s{},]+',' '
$lock = $lock -replace '^.*"packages":\s*',''
$lock = $lock -replace '"([^"]*)": "git": "([^"]*)" "tag": "[^"]*" "commit": "(\w+)" ',"`$1,`$2,`$3`n"
$names = @()
$lock -Split "`n" | Select-String ',' | %{
$fields = $_ -Split ','
$name = $fields[0]
$git = $fields[1]
$commit = $fields[2]
$names += $name
echo ('-' * 78)
echo "Installing package: $name"
cd "$root\packages"
[Environment]::CurrentDirectory = Get-Location
echo "=> git clone --recursive $git $name"
git clone --recursive $git $name
cd "$root\packages\$name"
[Environment]::CurrentDirectory = Get-Location
echo "=> git checkout $commit"
git checkout $commit
}
cd $root
[Environment]::CurrentDirectory = Get-Location
echo "=> meteor add $names"
meteor add $names