2012-03-24 54 views
12

Tôi gặp sự cố, bạn có thể chỉ cho tôi đúng hướng không?Làm thế nào để cài đặt Zombie JS trên Windows 7? (trình duyệt không có node.js)

EDIT: Mô-đun này (Contextify) sẽ không cài đặt từ npm trên Windows. Xem https://github.com/brianmcd/contextify/issues/10 để biết thêm thông tin.

Điều này là do NPM không hỗ trợ C++ module trên Windows nào: https://github.com/brianmcd/contextify/issues/14#issuecomment-3577972

Nói chung tôi muốn chạy http://zombie.labnotes.org - cho Windows họ đang đề xuất:

Trên Windows bạn sẽ cần Cygwin để có quyền truy cập vào GCC, Python, v.v. Đọc để biết hướng dẫn chi tiết và khắc phục sự cố: https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)

Vấn đề là - họ nói Cygwin mô tả là lỗi thời và đề nghị sử dụng Visual Studio ... Dù bằng cách nào tôi có cả hai và tôi đang dùng cơ hội của tôi bằng cách sử dụng trình cài đặt nodejs thay vì xây dựng nó từ đầu (lỗi dường như không liên quan đến nó). Và đây là các bước tôi đang làm:

1) Node.js cài đặt sử dụng cài đặt: http://nodejs.org/#download

2) Got NPM gói quản lý: https://github.com/isaacs/npm

3) Chấn Python 2.7, Visual Studio 2010 (như một số nguồn tin cho thấy C++ biên dịch khi cần thiết) và Cygwin ...

4) khi cài đặt không thành công ở contextify tôi đã tìm kiếm cho it

Sử dụng nhị phân được xây dựng trước chỉ cần tải về tập tin ZIP tại https://github.com/Benvie/contextify/zipball/master, giải nén nó vào thư mục node_modules của bạn, và sau đó đổi tên thư mục để "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> 

Những bước làm tôi cần phải thực hiện trong để làm cho nó hoạt động?

Nếu xây dựng nodejs từ các nguồn để cài đặt một gói phần mềm được yêu cầu thì hãy nói nó ồn ào :)

Cảm ơn vì đã giúp!

Trả lời

10

Điều này không trực tiếp trả lời câu hỏi của bạn, nhưng nó có thể giúp bạn giải quyết vấn đề bạn muốn sử dụng Zombie.js và có thể là thông tin tốt cho các SOers khác.

Ở giai đoạn này với Node v0.6 bạn sẽ chiến đấu trong trận chiến khó khăn để Zombie.js hoạt động trên Windows. Nút v0.8 sẽ làm cho điều này tốt hơn một chút với công tắc từ node-waf đến node-gyp. Tuy nhiên, nếu bạn muốn môi trường trình duyệt không đầu thực, bạn có thể xem PhantomJSCasperJS (khung kiểm tra cho PhantomJS). Nó không phải là một mô-đun Node, nhưng nó hoạt động thực sự tốt và là một trình duyệt không đầu thực sự không giống như Zombie.js, đó là một kiểu mô phỏng. PhantomJS hoạt động tốt trên Windows.

Hy vọng điều này có thể hữu ích với nhu cầu thử nghiệm/tìm kiếm trang web của bạn cho Windows.

+0

gì nếu tôi cần phải hỗ trợ cookie? http://stackoverflow.com/questions/9504765/does-phantomjs-support-cookies (Tôi sẽ chạy Ubuntu sau đó) –

+0

Nó hoạt động tốt với Cookie. Chỉ là các tập lệnh PhantomJS không thể truy cập cookie. tức là Bất kỳ trang web nào bạn mở trong PhantomJS sẽ hoạt động tốt với cookie, không phải là các tập lệnh PhantomJS của bạn. –

+0

Được rồi, sẽ thử. Tôi đã lo lắng rằng tôi thậm chí không thể chấp nhận một cookie: http://code.google.com/p/phantomjs/issues/detail?id=91 Cảm ơn bạn đã trợ giúp! –

9

Tôi có zombie đang chạy thành công trên hộp cửa sổ. Tôi không phải sử dụng Cygwin.

tôi có các phiên bản sau trên hộp của tôi:

  • Node 0.8.17
  • Python 2.7.3
  • Visual Studio 2010

Sau đó, hãy chắc chắn bạn đang chạy dòng cmd là quản trị viên và chạy lệnh cài đặt cho zombie.

npm install zombie

+1

_Visual Studio 2010_ là chìa khóa cho tôi! Đối với một số lý do có Visual Studio 2012 đã không làm việc .. – Ilya

+1

Python 2.7 + VS2012 thực hiện công việc này cho tôi. Bit của một kỳ lạ. –

+0

Giống như Ed Woodcock ở trên, đã làm việc tốt với tôi bằng Python 2.7.3. Chúc mọi người những điều may mắn nhất. – larryq

1

Nếu bạn có Visual Studio 2013 (thay vì Visual Studio 2010) thêm dòng sau vào lệnh NPM của bạn:

--msvs_version = 2013

Các vấn đề liên quan