在用Grunt和Yeoman时候有用到它。在windows下安装提示我:
```
C:\Users\Leo\AppData\Roaming\npm\phantomjs -> C:\Users\Leo\AppData\Roaming\npm\n
ode_modules\phantomjs\bin\phantomjs
>
[email protected] 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!
[email protected] install: `node install.js`
npm ERR! `cmd "/c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the
[email protected] 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貌似也没有找到解决方法。有遇到过的人一起交流下吧。