npm安装错误在上失败phantomjs@1.9.12安装脚本

npm安装错误在上失败phantomjs@1.9.12安装脚本,npm,Npm,我得到这个错误时,我试图做npm安装…我与此近4天…请有人能帮助我 npm ERR! Windows_NT 6.1.7601 npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Users\\Username\\AppData\\Roaming\\npm\\node_modules\\n pm\\bin\\npm-cli.js" "install" npm ERR! node v0.10.33 npm ERR! npm v

我得到这个错误时,我试图做npm安装…我与此近4天…请有人能帮助我

npm ERR! Windows_NT 6.1.7601  
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Users\\Username\\AppData\\Roaming\\npm\\node_modules\\n pm\\bin\\npm-cli.js" "install" 
npm ERR! node v0.10.33  
npm ERR! npm  v2.1.5  
npm ERR! code ELIFECYCLE  
npm ERR! errno ENOENT  
npm ERR! syscall spawn

npm ERR! phantomjs@1.9.12 install: `node install.js`  
npm ERR! spawn ENOENT  
npm ERR! 
npm ERR! Failed at the phantomjs@1.9.12 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.

我在Windows上遇到了完全相同的问题。为了修复它,我采取了以下步骤:

  • 通过下载和解压缩,在本地安装最新版本的phantomjs(当前为phantomjs-1.9.8-windows)。我以前的版本与phantomjs npm包不兼容
  • 更新环境变量以指向最新版本的phantomjs.exe(
    phantomjs_HOME
  • 退出并重新启动windows提示符或shell以识别变量
  • 现在,
    npm安装
    或者具体地说,
    npm安装phantomjs@1.9.12
    应能正常工作

  • 您可以在git bash shell或命令提示符下使用phantomjs和phantomjs-v测试本地phantomjs可执行文件安装。

    我在公司代理下工作,因此阻止npm从

    所以,我用下面的方法修复了它

  • 直接从上面的链接下载'phantomjs-2.1.1-windows.zip'文件
  • 复制并粘贴到“C:\Users\user\u name\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip”
  • 现在,只需执行“npm安装”,它将像一个符咒一样工作

  • 加里提出的解决方案很好。我相信您看到了这个问题,因为您没有安装
    python
    visualstudio
    。这些是自己构建幻影二进制插件所必需的。如果您下载预构建的二进制文件,您就不必安装它们。我不确定是否有帮助,但我在这里遇到了eNont问题,因为缺少bzip和tar UTIL。我在类似的环境中处理这个问题已经有一段时间了。这篇文章解决了这个问题。谢谢!