首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows8上运行towerjs会产生一个TypeError

在Windows8上运行towerjs会产生一个TypeError
EN

Stack Overflow用户
提问于 2013-01-10 18:58:00
回答 1查看 116关注 0票数 0

我在Windows8机器上安装了tower@0.4.2-22。在此之后,我尝试验证安装。我启动了mongod,塔式服务器,并在我的浏览器中调用http://localhost:3000。我收到错误消息(在浏览器窗口和服务器日志中):TypeError: Object Windows8没有方法'match‘at Object.Tower.MiddlewareAgent as handle at next (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect\lib\proto.js:199:15) at Object.handle (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\app\config\server\bootstrap.coffee:23:14)在multipart (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules的next (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect\lib\proto.js:199:15) at Object.methodOverride as handle at next (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules模块中urlencoded (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect\lib\middleware\urlencoded.js:51:37)处的\tower\node_modules\connect\lib\middleware\multipart.js:64:37) at module.exports (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect\lib\middleware\bodyParser.js:57:9)。导出(C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect\lib\middleware\bodyParser.js:55:7)

我试图弄清楚发生了什么,并发现在模块\node_modules\tower\lib\tower-middleware\server\agent.js中,方法调用mac:!!agent.os.match(/mac/i),windows:!!agent.os.match(/win/i),linux:!!agent.os.match(/linux/i)失败,因为agent.os是object类型而不是string类型。我用mac:!!agent.os.toString().match(/mac/i),windows:!!agent.os.toString().match(/win/i),linux:!!agent.os.toString().match(/linux/i)替换了这几行,然后塔启动并运行。

这是代码中的错误还是我的安装有问题?

首先,我用npm安装了-g,然后我用塔式新test01创建了一个应用程序,接下来的步骤是:- cd test01 - npm安装-永远的server.js (失败的永远没有安装)- npm安装永远的-g -永远的server.js (失败的mongodb没有启动)-(启动了mongodb) -永远的server.js (现在正在运行)-蛋糕手表(在另一个提示中-失败,因为grunt丢失)- npm安装grunt -g -蛋糕手表(现在它正在运行)-(转到浏览器并输入http://localhost:3000) -(参见上面的错误描述)

EN

回答 1

Stack Overflow用户

发布于 2013-01-11 21:53:07

似乎是最近的一个错误,可能是在最近的node.js版本或塔的其他依赖项中发生了变化,我注意到塔在过去的几天里突然收到了一些关于这方面的错误报告,看起来像someone submitted a patch last night,所以请注意拉取请求是否被接受,或者将其拉入到您自己的tower.js分支中并重试。

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

https://stackoverflow.com/questions/14256315

复制
相关文章

相似问题

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