2012-03-24 9 views
12

私は問題を抱えていますが、正しい方向に向けることができますか?Windows 7にZombie JSをインストールするには? (node.jsヘッドレスブラウザ)

EDIT:このモジュール(Contextify)はWindowsではnpmからインストールされません。詳細は、https://github.com/brianmcd/contextify/issues/10を参照してください。あなたは、Cygwinを必要があります。Windowsの

: - Windows用、彼らが示唆されているhttps://github.com/brianmcd/contextify/issues/14#issuecomment-3577972

は、一般的に、私はhttp://zombie.labnotes.orgを実行したいと思います:NPMはまだWindows上でC++モジュールをサポートしていないため

はこれがあります彼らはCygwinを言う - https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)

問題がある:などGCC、Pythonの、へのアクセスを得るために、詳細な手順やトラブルシューティングのための これを読みます説明は時代遅れであり、Visual Studioを使用することをお勧めします...いずれにしても、私は両方を得て、nodejsインストーラを使用してチャンスを得ています。(エラーはそれに関係しているように見えません)。そして、ここで私がやっている手順は次のとおりです。インストーラを使用して

1)インストール済みのNode.js:http://nodejs.org/#download

2)は、NPMのパッケージマネージャを手に入れた:https://github.com/isaacs/npm

3)ガットのPython 2.7は、Visual Studio 2010には、(いくつかのソースは、必要に応じて、C++コンパイラを示すように)とCygwin ...

4)インストーラがcontextifyで失敗したとして、私はit

検索、 https://github.com/Benvie/contextify/zipball/masterでZIPファイルをダウンロード あなたnode_modulesのフォルダに解凍した後、私は確認する必要がありますどのような手順

c:\Program Files (x86)\nodejs>node --version 
v0.6.13 

c:\Program Files (x86)\nodejs>npm install zombie 
npm http GET https://registry.npmjs.org/zombie 
npm http 304 https://registry.npmjs.org/zombie 
npm http GET https://registry.npmjs.org/ws 
npm http GET https://registry.npmjs.org/jsdom/0.2.10 
npm http GET https://registry.npmjs.org/mime 
npm http GET https://registry.npmjs.org/coffee-script 
npm http 304 https://registry.npmjs.org/ws 
npm http 304 https://registry.npmjs.org/mime 
npm http 304 https://registry.npmjs.org/jsdom/0.2.10 
npm http 304 https://registry.npmjs.org/coffee-script 

> [email protected] preinstall c:\Program Files (x86)\nodejs\node_modules\zombie\node_mo 
dules\ws 
> make 

     1 file(s) copied. 
     1 file(s) copied. 
npm http GET https://registry.npmjs.org/commander/0.5.0 
npm http GET https://registry.npmjs.org/options 
npm http 304 https://registry.npmjs.org/options 
npm http 304 https://registry.npmjs.org/commander/0.5.0 
npm http GET https://registry.npmjs.org/contextify 
npm http GET https://registry.npmjs.org/request 
npm http GET https://registry.npmjs.org/htmlparser 
npm http GET https://registry.npmjs.org/cssom 
npm http 304 https://registry.npmjs.org/contextify 
npm http 304 https://registry.npmjs.org/htmlparser 
npm http 304 https://registry.npmjs.org/request 
npm http 304 https://registry.npmjs.org/cssom 

> [email protected] preinstall c:\Program Files (x86)\nodejs\node_modules\zombie\ 
node_modules\jsdom\node_modules\contextify 
> node-waf clean || (exit 0); node-waf configure build 

node-waf was unexpected at this time. 

npm ERR! Error: ENOENT, chmod 'c:\Program Files (x86)\nodejs\node_modules\zombie 
\node_modules\jsdom\node_modules\request\tests\squid.conf' 
npm ERR! You may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 
npm ERR! 
npm ERR! System Windows_NT 6.1.7600 
npm ERR! command "c:\\Program Files (x86)\\nodejs\\\\node.exe" "c:\\Program File 
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "zombie" 
npm ERR! cwd c:\Program Files (x86)\nodejs 
npm ERR! node -v v0.6.13 
npm ERR! npm -v 1.1.9 
npm ERR! path c:\Program Files (x86)\nodejs\node_modules\zombie\node_modules\jsd 
om\node_modules\request\tests\squid.conf 
npm ERR! fstream_path c:\Program Files (x86)\nodejs\node_modules\zombie\node_mod 
ules\jsdom\node_modules\request\tests\squid.conf 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! fstream_finish_call chmod 
npm ERR! code ENOENT 
npm ERR! message ENOENT, chmod 'c:\Program Files (x86)\nodejs\node_modules\zombi 
e\node_modules\jsdom\node_modules\request\tests\squid.conf' 
npm ERR! errno {} 
npm ERR! fstream_stack Object.oncomplete (c:\Program Files (x86)\nodejs\node_mod 
ules\npm\node_modules\fstream\lib\writer.js:285:17) 

npm ERR! Error: ENOENT, lstat 'c:\Program Files (x86)\nodejs\node_modules\zombie 
\node_modules\jsdom\node_modules\htmlparser\runtests.html' 
npm ERR! You may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 
npm ERR! 
npm ERR! System Windows_NT 6.1.7600 
npm ERR! command "c:\\Program Files (x86)\\nodejs\\\\node.exe" "c:\\Program File 
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "zombie" 
npm ERR! cwd c:\Program Files (x86)\nodejs 
npm ERR! node -v v0.6.13 
npm ERR! npm -v 1.1.9 
npm ERR! path c:\Program Files (x86)\nodejs\node_modules\zombie\node_modules\jsd 
om\node_modules\htmlparser\runtests.html 
npm ERR! fstream_path c:\Program Files (x86)\nodejs\node_modules\zombie\node_mod 
ules\jsdom\node_modules\htmlparser\runtests.html 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! code ENOENT 
npm ERR! message ENOENT, lstat 'c:\Program Files (x86)\nodejs\node_modules\zombi 
e\node_modules\jsdom\node_modules\htmlparser\runtests.html' 
npm ERR! errno {} 
npm ERR! fstream_stack Object.oncomplete (c:\Program Files (x86)\nodejs\node_mod 
ules\npm\node_modules\fstream\lib\writer.js:204:26) 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  c:\Program Files (x86)\nodejs\npm-debug.log 
npm not ok 

c:\Program Files (x86)\nodejs> 

を「contextify」するフォルダの名前を変更するだけで事前に構築されたバイナリを使用しますそれを操作可能にするには?パッケージをインストールするには、ソースからビルドするnodejsが必要な場合は

その後、大声でそれを言うてください:)助けるため

感謝を!

答えて

10

これはあなたの質問に直接答えませんが、あなたがZombie.jsを使用したいという問題を解決するのに役立ち、他のSOersの良い情報になる可能性があります。

この段階でノードv0.6を使用すると、Zombie.jsをWindows上で動作させるうまくいった戦いに挑戦します。ノードv0.8は、node-wafからnode-gypへのスイッチでこれを少し改善します。

実際のヘッドレスブラウザ環境をご希望の場合は、PhantomJSCasperJS(PhantomJSのテストフレームワーク)をご覧ください。これはNodeモジュールではありませんが、実際にはうまく動作し、Zombie.jsとは異なり、真のヘッドレスブラウザです。ソームのエミュレーションです。 PhantomJSはWindows上でうまく動作します。

これは、Windowsのサイトテスト/スクレイピングのニーズに役立ちます。

+0

を? http://stackoverflow.com/questions/9504765/does-phantomjs-support-cookies (私はUbuntuを実行します) –

+0

クッキーでうまく動作します。 PhantomJSスクリプト自体がクッキーにアクセスできないということだけです。つまり、PhantomJSで開いたウェブページは、PhantomJSスクリプトではなくクッキーで正常に動作します。 –

+0

それでは、試してみましょう。私はクッキーを受け入れることさえできないと心配しました:http://code.google.com/p/phantomjs/issues/detail?id=91助けてくれてありがとう! –

9

私はゾンビをWindowsボックスで正常に実行しています。私はcygwinを使う必要はありませんでした。

私は私のボックスに、次のバージョンがあります:

  • ノード0.8.17
  • のPython 2.7.3
  • のVisual Studioその後2010

を、あなたが実行していることを確認してくださいcmd行を管理者として実行し、ゾンビのinstallコマンドを実行します。

npm install zombie

+1

_Visual Studio 2010_は私のために重要でした!何らかの理由でVisual Studio 2012が動作しませんでした。 – Ilya

+1

Python 2.7 + VS2012が私のために作ったものです。奇妙なもの。 –

+0

上記のEd Woodcockと同じですが、Python 2.7.3でうまくいきました。すべての人に最高の運があります。 – larryq

1

ます(代わりのVisual Studio 2010)のVisual Studio 2013を使用している場合は、あなたのNPMコマンドに次の行を追加します。私はクッキーをサポートする必要がある場合はどう

--msvs_version = 2013

関連する問題