如何在Windows 7上安装僵尸JS ?(节点。js无头浏览器)

时间:2023-01-12 14:30:56

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.

编辑:这个模块(context tify)将不会在Windows上从npm安装。更多信息请参见https://github.com/brianmcd/context tify/issues/10。

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

这是因为npm还不支持Windows上的c++模块:https://github.com/brianmcd/context tify/issues/14# issues ecomecomecomecomecommit3577972

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

一般来说,我想运行http://zombie.labnotes.org——对于Windows,他们建议:

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)

在Windows上,你需要Cygwin才能访问GCC、Python等。

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:

问题是-他们说Cygwin的描述已经过时了,建议使用Visual Studio…无论哪种方式,我都得到了这两个,我正在冒险使用nodejs安装程序,而不是从头构建它(错误似乎与它无关)。下面是我正在做的步骤:

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

1)安装节点。js使用安装程序:http://nodejs.org/下载

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

2)获得NPM包管理器:https://github.com/isaacs/npm

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

3)获得Python 2.7、Visual Studio 2010(如某些来源指出需要c++编译器)和Cygwin…

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

4)当安装程序在context tify失败时,我搜索了一下

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"

使用预构建的二进制文件,只需下载https://github.com/benvie/context tify/zipball/master的ZIP文件,将其解压到node_modules文件夹中,然后将文件夹重命名为“context”

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

> ws@0.4.10 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

> contextify@0.0.7 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!     <npm-@googlegroups.com>
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!     <npm-@googlegroups.com>
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 :)

如果需要从源代码构建nodejs来安装包,请大声说:)

Thanks for helping!

谢谢你的帮助!

3 个解决方案

#1


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.

这并不能直接回答你的问题,但它可以帮助你解决你想要使用僵尸的问题。js对于其他soer来说是很好的信息。

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.

在这个节点v0。6的阶段,你将会为了获得僵尸而进行一场艰苦的战斗。js在Windows上工作。从节点waf到节点gyp的切换,Node v0.8将使这一点变得更好。

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.

但是,如果您想要真正的无头浏览器环境,您可能需要查看PhantomJS和CasperJS (PhantomJS的测试框架)。它不是一个节点模块,但是它工作得很好,而且不像僵尸那样是一个真正的无头浏览器。这是一种模拟。PhantomJS在Windows上很好用。

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

希望这对您的站点测试/抓取Windows有帮助。

#2


9  

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

我让宗比杰在windows操作系统上成功运行。我不需要使用cygwin。

I have the following versions on my box:

我的盒子上有以下版本:

  • Node 0.8.17
  • 节点0.8.17
  • Python 2.7.3
  • Python 2.7.3
  • Visual Studio 2010
  • Visual Studio 2010

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

之后,请确保以管理员的身份运行cmd行并运行zombie的install命令。

npm install zombie

npm安装僵尸

#3


1  

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

如果您有Visual Studio 2013(而不是Visual Studio 2010),请在您的NPM命令中添加以下内容:

--msvs_version=2013

——msvs_version = 2013

#1


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.

这并不能直接回答你的问题,但它可以帮助你解决你想要使用僵尸的问题。js对于其他soer来说是很好的信息。

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.

在这个节点v0。6的阶段,你将会为了获得僵尸而进行一场艰苦的战斗。js在Windows上工作。从节点waf到节点gyp的切换,Node v0.8将使这一点变得更好。

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.

但是,如果您想要真正的无头浏览器环境,您可能需要查看PhantomJS和CasperJS (PhantomJS的测试框架)。它不是一个节点模块,但是它工作得很好,而且不像僵尸那样是一个真正的无头浏览器。这是一种模拟。PhantomJS在Windows上很好用。

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

希望这对您的站点测试/抓取Windows有帮助。

#2


9  

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

我让宗比杰在windows操作系统上成功运行。我不需要使用cygwin。

I have the following versions on my box:

我的盒子上有以下版本:

  • Node 0.8.17
  • 节点0.8.17
  • Python 2.7.3
  • Python 2.7.3
  • Visual Studio 2010
  • Visual Studio 2010

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

之后,请确保以管理员的身份运行cmd行并运行zombie的install命令。

npm install zombie

npm安装僵尸

#3


1  

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

如果您有Visual Studio 2013(而不是Visual Studio 2010),请在您的NPM命令中添加以下内容:

--msvs_version=2013

——msvs_version = 2013