tower@0.4.2-22
Windows 8マシンにインストールしました。この後、インストールを確認しようとしました。タワーサーバーであるmongodサーバーを起動して呼び出しましたhttp://localhost:3000
私のブラウザで。エラー メッセージが表示されます (ブラウザー ウィンドウとサーバー ログ): TypeError: Object Windows 8 has no method 'match' at Object.Tower.MiddlewareAgent [as handle] (C:\Users\Philipp\Documents\Scripts\tower\Tests \test01\node_modules\tower\lib\tower-middleware\server\agent.js:13:21) 次に (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect) \lib\proto.js:199:15) Object.handle (C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\app\config\server\bootstrap.coffee:23:14) で次の ( C:\Users\Philipp\Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect\lib\proto.js:199:15) Object.methodOverride [ハンドルとして] (C:\Users\Philipp) \Documents\Scripts\tower\Tests\test01\node_modules\tower\node_modules\connect\lib\middleware\methodOverride.js:37:
何が起こったのかを調べてみたところ、モジュール \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 が文字列ではなくオブジェクト型であるため、失敗しました。行を mac: !!agent.os.toString().match(/mac/i)、windows: !!agent.os.toString().match(/win/i)、linux: !!agent に置き換えました。 .os.toString().match(/linux/i) とタワーが起動し、実行されています。
これはコードのバグですか、それともインストールに何か問題がありましたか?
最初に npm install power -g でタワーをインストールしてから、tower new test01 でアプリを作成しました 次の手順は次のとおりです。 forever server.js (失敗した mongod が開始されなかった) - (mongodb が開始された) - forever server.js (現在実行中) - cake watch (別のプロンプトで - grunt が見つからないため失敗した) - npm install grunt -g - cake watch (実行中) - (ブラウザに移動して と入力http://localhost:3000
) - (上記のエラーの説明を参照)