How to install Zombie JS on Windows 7? (node.js headless browser)
Asked Answered
D

3

12

I am having issues, could you point me in the right direction?

EDIT: This module (Contextify) will not install from npm on Windows. See https://github.com/brianmcd/contextify/issues/10 for more info.

This is because npm doesn't support C++ modules on Windows yet: https://github.com/brianmcd/contextify/issues/14#issuecomment-3577972

Generally I would like to run http://zombie.labnotes.org - for Windows they are suggesting:

On Windows you'll need Cygwin to get access to GCC, Python, etc. Read this for detailed instructions and troubleshooting: https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)

The problem is - they say Cygwin description is outdated and suggest using Visual Studio... Either way I got both and I am taking my chances by using nodejs installer rather that building it from scratch (error doesn't seem related to it). And here are the steps I'm doing:

1) Installed node.js using installer: http://nodejs.org/#download

2) Got NPM package manager: https://github.com/isaacs/npm

3) Got Python 2.7, Visual Studio 2010 (as some sources indicated C++ compiler as necessary) and Cygwin...

4) As the installer fails at contextify I searched for it

Use the pre-built binary just download the ZIP file at https://github.com/Benvie/contextify/zipball/master , extract it into your node_modules folder, and then rename the folder to "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>

What steps do I need to make in order to make it operational?

If building nodejs from sources to install a package is required then please say it loud :)

Thanks for helping!

Detonator answered 24/3, 2012 at 13:0 Comment(0)
E
10

This doesn't directly answer your question, but it may help you solve your problem that you wanted to use Zombie.js for and could be good info for other SOers.

At this stage with Node v0.6 you're going to be fighting an uphill battle to get Zombie.js working on Windows. Node v0.8 will make this a bit better with the switch from node-waf to node-gyp.

However, if you want real headless browser environment, you may want to take a look at PhantomJS and CasperJS (testing framework for PhantomJS). It's not a Node module, but it works really well and is a true headless browser unlike Zombie.js which is an emulation of sorts. PhantomJS works well on Windows.

Hope this might help with your site testing/scraping needs for Windows.

Ernie answered 24/3, 2012 at 15:10 Comment(3)
What if I need to support cookies? #9505265 (I will run Ubuntu then)Detonator
It works fine with Cookies. It's just that PhantomJS scripts themselves can't access cookies. i.e. Any webpage that you open in PhantomJS will work fine with cookies, just not your PhantomJS scripts.Ernie
Allright then, will give it a try. I was worried that I cannot even accept a cookie: code.google.com/p/phantomjs/issues/detail?id=91 Thanks for help!Detonator
A
9

I have zombiejs running successfully on a windows box. I didn't have to use cygwin.

I have the following versions on my box:

  • Node 0.8.17
  • Python 2.7.3
  • Visual Studio 2010

After that, make sure you are running the cmd line as administrator and run the install command for zombie.

npm install zombie

Acaleph answered 25/1, 2013 at 16:2 Comment(4)
Visual Studio 2010 was key for me! For some reason having Visual Studio 2012 did not work..Priestcraft
Python 2.7 + VS2012 made this work for me. Bit of a weird one.Catena
Same as Ed Woodcock above, worked good for me with Python 2.7.3. Best of luck to all.Metallography
Python 2.7.7 + VS2013 - didn't work; Python 2.7.7 + VS2010 - SUCCESS!Iq
M
1

If you have Visual Studio 2013 (instead of Visual Studio 2010) add the following to your NPM command:

--msvs_version=2013

Masquer answered 6/12, 2014 at 15:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.