我遇到了問題,能否指點我正確的方向?如何在Windows 7上安裝Zombie JS? (node.js無頭瀏覽器)
編輯:這個模塊(Contextify)不會從Windows上的npm安裝。有關更多信息,請參閱https://github.com/brianmcd/contextify/issues/10。
這是因爲故宮不支持C++模塊在Windows上尚未:https://github.com/brianmcd/contextify/issues/14#issuecomment-3577972
一般來說,我想運行http://zombie.labnotes.org - 適用於Windows,他們所提出的建議:
在Windows上,你需要的Cygwin以訪問GCC,Python等閱讀 本作的詳細說明和故障排除:https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)
的問題是 - 他們說的Cygwin描述已過時,並建議使用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
使用預製的二進制剛纔下載的ZIP文件在 https://github.com/Benvie/contextify/zipball/master,將其解壓縮到 你node_modules文件夾,然後重命名文件夾「contextify」
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>
什麼步驟,我需要做的爲了使其運作?
如果建設從源到的NodeJS安裝需要一個包,那麼請大聲說出來:)
感謝您的幫助!
如果我需要支持cookie? http://stackoverflow.com/questions/9504765/does-phantomjs-support-cookies (我將運行Ubuntu然後) – 2012-03-24 15:23:30
它可以正常使用Cookies。 PhantomJS腳本本身無法訪問Cookie。即您在PhantomJS中打開的任何網頁都可以正常使用Cookie,而不是您的PhantomJS腳本。 – 2012-03-24 15:34:50
好了,那就試試看吧。我擔心我甚至無法接受cookie:http://code.google.com/p/phantomjs/issues/detail?id=91感謝您的幫助! – 2012-03-24 15:37:28