npm 安装错误在 phantomjs@1.9.12 安装脚本中失败 [英] npm install error Failed at the phantomjs@1.9.12 install script
本文介绍了npm 安装错误在 phantomjs@1.9.12 安装脚本中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在尝试进行 npm install 时遇到此错误...我对此感到震惊近 4 天...请有人帮我...
I am getting this error when am trying to do npm install...am struck with this nearly for 4 days...please can someone help me out...
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 上遇到了完全相同的问题.为了解决这个问题,我采取了以下步骤:
I had the exact same issue on Windows. To fix it, I took the following steps:
- 通过下载和解压缩在本地安装最新版本的 phantomjs(当前为 phantomjs-1.9.8-windows).我以前的版本与 phantomjs npm 包不兼容.
- 更新您的环境变量以指向最新版本的 phantomjs.exe (
PHANTOMJS_HOME
). - 退出并重新启动 Windows 提示符或 shell 以识别变量.
- 现在,
npm install
或者特别是npm install phantomjs@1.9.12
应该可以正常工作.
- Install the latest version of phantomjs (currently, phantomjs-1.9.8-windows) locally, by downloading and unziping. I had a previous version which was not compatible with phantomjs npm package.
- Update your environment variable to point to latest version of phantomjs.exe (
PHANTOMJS_HOME
). - Exit and restart windows prompt or shell to recognize variable.
- Now,
npm install
or specifically,npm install phantomjs@1.9.12
should work correctly.
您可以使用来自 git bash shell 或命令提示符的 where phantomjs
和 phantomjs -v
测试本地 phantomjs 可执行文件安装.
You can test your local phantomjs executable install with a where phantomjs
and phantomjs -v
from a git bash shell or command prompt.
这篇关于npm 安装错误在 phantomjs@1.9.12 安装脚本中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文