node.js - 无法安装 PhantomJS 以在 Node.js 中使用

标签 node.js npm phantomjs installation

这是整个交易......至少是我能看到的部分。我安装了几个 npm 软件包,它们都可以工作,除了 phantomjs (不是 phantom)。这是整个交易...至少是我能看到的部分。

> npm install phantomjs
\
> phantomjs@1.9.18 install C:\server\nodejs\node_modules\phantomjs
> node install.js

'node' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\server\\nodejs\\\\node.exe" "C:\\server\\nodejs   \\node_modules\\npm\\bin\\npm-cli.js" "install" "phantomjs"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! phantomjs@1.9.18 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.18 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\server\nodejs\npm-debug.log

nodemon(和 Node )命令适用于文件夹 C:\server\nodejs。其他软件包安装在此处并最终位于子文件夹中:C:\server\nodejs\node_modules。看起来该包正在尝试运行“node install.js”,但目录错误..

似乎我已经阅读了我能找到的所有内容,但几天后我不得不问:有人知道发生了什么事吗?

最佳答案

注意:有一个名为 phantomjs 的包和一个名为 phantom 的包。没有相同的包。主要的 phantomjs 是 phantomjs 包。 Phantom 是 phantomjs 的包装器,它创建了一个桥梁(简单地说:使 phantomjs 与 Nodejs 一起工作)。我安装了 phantom,以为我正在使用 phantomjs。要使用phantom,您必须先安装phantomjs。

关于node.js - 无法安装 PhantomJS 以在 Node.js 中使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33621171/

相关文章:

json - npm 中忽略了 devDependency?

javascript - 为什么 document.querySelectorAll() 返回第一个元素以外的空元素?

python - Splash/PhantomJS(用于 JavaScript 渲染)可以与 Wget 一起下载网页吗?

git - 使用 git archive 作为 npm 依赖项

node.js - Ubuntu 9.04 上的 npm 安装问题

javascript - 使用 casperjs 提交表单 - 新 url 不加载

javascript - 使用for循环在.docx文件中使用js和npm docx写一段

node.js - swagger-express-mw 中的错误处理

javascript - 如何使用 Node 模块从ajax.inc.php页面获取数据?

javascript - 配置 Webpack 输出包