【问题标题】:Cannot install PhantomJS for use in node.js无法安装 PhantomJS 以在 node.js 中使用
【发布时间】:2015-11-10 01:05:57
【问题描述】:

这是整个交易......至少我能看到的部分。我安装了几个 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(和节点)命令适用于文件夹 C:\server\nodejs。其他软件包安装在此处并最终位于子文件夹中:C:\server\nodejs\node_modules。看起来包正在尝试运行“node install.js”但目录错误..

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

【问题讨论】:

  • 你有全局安装节点吗?喜欢你可以从任何目录使用它吗?

标签: node.js npm phantomjs installation


【解决方案1】:

注意:有一个包叫phantomjs,一个包叫phantom。有不一样的包。主要的 phantomjs 适当地是 phantomjs 包。 Phantom 是 phantomjs 的包装器,它创建了一个桥(简单地说:使 phantomjs 与 nodejs 一起工作)。我已经安装了幻象,以为我正在使用 phantomjs。要使用phantom,必须先安装phantomjs。

【讨论】:

  • 各位审稿人:这答案。这是 OP 解释导致他们问题的原因。
猜你喜欢
  • 1970-01-01
  • 2013-09-02
  • 2016-09-11
  • 2015-04-15
  • 1970-01-01
  • 2018-06-23
  • 1970-01-01
  • 2017-10-06
  • 2013-12-22
相关资源
最近更新 更多