windows下npm安装PhantomJS失败?

2013-05-25 11:10:57 +08:00
 leohxj
在用Grunt和Yeoman时候有用到它。在windows下安装提示我:
```
C:\Users\Leo\AppData\Roaming\npm\phantomjs -> C:\Users\Leo\AppData\Roaming\npm\n
ode_modules\phantomjs\bin\phantomjs

> phantomjs@1.9.0-4 install C:\Users\Leo\AppData\Roaming\npm\node_modules\phanto
mjs
> node install.js

Download already available at C:\Users\Leo\AppData\Local\Temp\phantomjs\phantomj
s-1.9.0-windows.zip
Extracting zip contents
Phantom installation failed ReferenceError: err is not defined
at extractDownload (C:\Users\Leo\AppData\Roaming\npm\node_modules\phantomjs\
install.js:155:53)
at Promise._successFn (C:\Users\Leo\AppData\Roaming\npm\node_modules\phantom
js\install.js:68:12)
at Promise._withInput (C:\Users\Leo\AppData\Roaming\npm\node_modules\phantom
js\node_modules\kew\kew.js:204:25)
at Promise._chainPromise (C:\Users\Leo\AppData\Roaming\npm\node_modules\phan
tomjs\node_modules\kew\kew.js:244:13)
at Promise.then (C:\Users\Leo\AppData\Roaming\npm\node_modules\phantomjs\nod
e_modules\kew\kew.js:144:13)
at C:\Users\Leo\AppData\Roaming\npm\node_modules\phantomjs\install.js:67:11
at C:\Users\Leo\AppData\Roaming\npm\node_modules\phantomjs\node_modules\npmc
onf\npmconf.js:76:7
at Array.forEach (native)
at C:\Users\Leo\AppData\Roaming\npm\node_modules\phantomjs\node_modules\npmc
onf\npmconf.js:75:13
at C:\Users\Leo\AppData\Roaming\npm\node_modules\phantomjs\node_modules\npmc
onf\node_modules\once\once.js:17:15
npm ERR! phantomjs@1.9.0-4 install: `node install.js`
npm ERR! `cmd "/c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.0-4 install script.
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! System Windows_NT 6.1.7601
npm ERR! command "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "phantomjs" "-g"
npm ERR! cwd C:\Windows\System32
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Windows\System32\npm-debug.log
npm ERR! not ok code 0
```
看github上的issue貌似也没有找到解决方法。有遇到过的人一起交流下吧。
8356 次点击
所在节点    Node.js
1 条回复
jinwyp
2013-06-21 13:57:26 +08:00
换一个npm 这个在windows下有问题 换 var phantom = require('node-phantom');

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/70104

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX