bower初始化命令错误(gitbash)在Windows中 [英] bower init command error (gitbash) in windows
问题描述
当我在gitbash中运行bower init时,显示以下错误:
$ b
bower ENOINT Register需要一个交互式shell
其他错误详细信息:请注意,您可以使用--config.interactive手动强制
交互式shell
<解决方案
问题: mintty.exe
我跟踪了
mintty.exe
。
在
bower / lib / config.js
file(第34行为bower v 1.4.1),tty.isatty(1)
在mintty.exe
,但如果运行cygwin.bat
(它是bash --login -i
使用Windows终端)。
以下是检查终端的简便方法:
node - evar tty = require('tty'); console.log('tty.isatty(1):'+ tty.isatty(1))
可能相关: mintty - 问题#56改进对本机控制台程序的支持 。
$ b
对于那些在寻找解决方案时遇到问题的人来说,解决此问题的显而易见的快速解决方法是简单地避免使用mintty。
这并不意味着您必须返回使用Windows终端进行bash,因为还有其他选择:
有关使用bash配置Console2的说明。
- 请参阅 Windows 7中的终端设置和/或<用Console2代替默认的git bash控制台
关闭菜单,工具栏和状态栏,
创建一个名为 Cygwin
或Bash
的快捷方式,将快捷方式的图标更改为C:\cygwin64\Cygwin-Terminal.ico
,您可能永远不会知道它们的区别。
PS如果你曾经注意到
mintty.exe
的其他问题,比如msysgit没有正确提示输入密码,或者节点repl不工作,这可能是同样的问题。 p>
解决方法:
- 通过运行命令执行此操作
cmd.exe / CC:\ Program Files \Git\bin\bash.exe--login -i
然后
bower init
可以工作,您可以在minw64中完成所有工作, mintty或git-bash。
OR
如果您正在使用Windows运行bower init,使用CMD
OR
如果您使用的是git bash,请按照以下步骤操作:
- 卸载现有的GIT bash
- 重新安装GIT bash
$ bli>
- 3a:选择>在Windows命令提示符下使用Git
- 3b:选择>签出Windows风格,提交Unix风格的行结尾
- 3c:选择>使用Windows的默认控制台窗口
When i run bower init in gitbash ,following error is displayed:
bower ENOINT Register requires an interactive shell
Additional error details: Note that you can manually force an interactive shell with --config.interactive
Issue: mintty.exe
Issue 802 does provide a good explanation:
I've tracked this down to an issue with
mintty.exe
.In the
bower/lib/config.js
file (line 34 for bower v 1.4.1),tty.isatty(1)
returns false undermintty.exe
, but true if you runcygwin.bat
(which isbash --login -i
using the Windows terminal).Here's a convenient way to check your terminal:
node -e "var tty=require('tty'); console.log('tty.isatty(1):' + tty.isatty(1))"
Possibly related: mintty - issue #56 "Improve support for native console programs".
For those stumbling across this issue looking for a solution, the obvious quick workaround for this issue is to simply avoid using mintty.
This doesn't mean you have to return to using the Windows terminal for bash, as there are other alternatives:
- See Terminal Setup in Windows 7 and/or Replacing default git bash console with Console2 for instructions for configuring Console2 with bash.
- Turn off the menus, tool bars, and status bars,
- create a shortcut named "
Cygwin
" or "Bash
", change the shortcut's icon toC:\cygwin64\Cygwin-Terminal.ico
and you'll probably never know the difference.P.S. If you've ever noted other issues with
mintty.exe
, like msysgit not prompting for a password properly or the node repl not working, this is probably the same issue.
Workarounds:
- do this from the run command
cmd.exe /C "C:\Program Files\Git\bin\bash.exe" --login -i
then
bower init
will work and you can do everything in minw64, mintty, or git-bash whatever it is called.
OR
If you are using windows run bower init using CMD
OR
if you are using git bash follow these steps:
- Uninstall existing GIT bash
- Reinstall GIT bash
- Set up during installation:
- 3a: Select> Use Git form the Windows Command Prompt
- 3b: Select> Checkout Windows-style, commit Unix-style line endings
- 3c: Select> Use Windows' default console window
这篇关于bower初始化命令错误(gitbash)在Windows中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!