V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
leohxj
V2EX  ›  Node.js

windows下npm安装PhantomJS失败?

  •  
  •   leohxj · 2013-05-25 11:10:57 +08:00 · 8316 次点击
    这是一个创建于 3982 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在用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貌似也没有找到解决方法。有遇到过的人一起交流下吧。
    第 1 条附言  ·  2013-06-01 21:01:24 +08:00
    删除C:\Users\Leo\AppData\Roaming\npm\node_modules\phanto
    mjs,重新安装又可以了。
    1 条回复    1970-01-01 08:00:00 +08:00
    jinwyp
        1
    jinwyp  
       2013-06-21 13:57:26 +08:00
    换一个npm 这个在windows下有问题 换 var phantom = require('node-phantom');
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3448 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 04:50 · PVG 12:50 · LAX 21:50 · JFK 00:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.