After updating bower to 1.2.1, the bower init command seems to fail. When running the bower init the follow result is shown:
Here is the Stack Trace when run in verbose mode:
bower ENOINT Register requires interactive
Stack trace:
Error: Register requires interactive
at createError (/usr/local/lib/node_modules/bower/lib/util/createError.js:4:15)
at /usr/local/lib/node_modules/bower/lib/commands/init.js:24:34
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Console trace:
Trace
at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:74:17)
at Logger.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:108:18)
at Logger.EventEmitter.emit (events.js:96:17)
at Logger.emit (/usr/local/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /usr/local/lib/node_modules/bower/lib/commands/init.js:24:20
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
System info:
Bower version: 1.2.1
Node version: 0.8.19
OS: Darwin 13.0.0 x64
Hey @jinmatt!
npm install bower -g) or are you actually have it cloned locally and npm link? In case you have a linked copy of bower in 2. you have to do npm install inside the cloned bower directory.
The interactive flag is being set here: https://github.com/bower/bower/blob/master/lib/config.js#L11 you can debug that with a console.log(config) before the if statement and one afterwards, including process.title and isatty.
Note that you can enable it anyway with --config.interactive, but worth investigating why your terminal is not a reporting itself as a tty.
@satazor
I'm using oh-my-zsh. I have installed bower using npm(npm install -g bower), and updated bower lately using npm update -g bower
@jinmatt I've tried oh-my-zsh and it works. Can you try to uninstall bower and install it again?
Tried that, but getting the same result again.
Uninstalled bower 1.2.1 and installed 0.10.0, and now bower init is working.
@jinmatt the only difference I'm having is that I was running on MacOSx. Anyway, I will remove that check on the init command and release a new version today. I advise against downgrading to 0.10.0. Bower <1.0.0 has a lot of issues.
Oops didn't wanted to close.
@jinmatt anyway, even if I remove that check, you will be running bower with interactive set to false, meaning it won't prompt you questions whenever necessary.
Can you please do the following:
$ node
var tty = require('tty');
tty.isatty(1);
What does it output?
Bump.
@satazor
the output I get:
> var tty = require('tty');
undefined
> tty.isatty(1);
true
@satazor btw I'm too running on a Mac OS X. But on 10.9 Preview 5, do you think this might be a cause of this issue?
Updated to 1.2.2 now. Now when I run bower init I get this Additional error details
bower ENOINT Register requires an interactive shell
Additional error details:
Note that you can manually force an interactive shell with --config.interactive
So I tried running bower init --config.interactive and the interactive prompt is working
Yes I've improved the error message. Still I would like to know why this is happening to you, since it can be affecting other users. Can you please do the following:
npm link inside the cloned folder (with sudo)console.log(config) here https://github.com/bower/bower/blob/master/lib/config.js#L5bower -vDone:
➜ bower git:(master) bower -v
{ cwd: '/Users/jinmatt/Documents/Workdesk/sandbox/bowerBox/bower',
directory: 'bower_components',
registry:
{ search: [ 'https://bower.herokuapp.com' ],
register: 'https://bower.herokuapp.com',
publish: 'https://bower.herokuapp.com' },
shorthandResolver: 'git://github.com/{{owner}}/{{package}}.git',
tmp: '/var/folders/tf/rvwhrxms15x20gdxgggsy3zr0000gp/T/jinmatt/bower',
timeout: 30000,
ca: { search: [] },
strictSsl: true,
userAgent: 'node/v0.8.19 darwin x64',
color: true,
storage:
{ packages: '/Users/jinmatt/.cache/bower/packages',
links: '/Users/jinmatt/.local/share/bower/links',
completion: '/Users/jinmatt/.local/share/bower/completion',
registry: '/Users/jinmatt/.cache/bower/registry',
empty: '/Users/jinmatt/.local/share/bower/empty' } }
1.2.2
Looks good.
Add console.log(config.interactive), console.log(process.title) and console.log(tty.isatty(1) to https://github.com/bower/bower/blob/master/lib/config.js#L11 and please report back.
Was going through the code, seems like I'm getting process.title = 'node' and not equal to 'bower' as expected to make config.interactive = true in config.js line 12. So if I change the string 'bower' to 'node', bower init works.
Here are the logs which you requested:
➜ bower git:(master) ✗ bower -v
{ cwd: '/Users/jinmatt/Documents/Workdesk/sandbox/bowerBox/bower',
directory: 'bower_components',
registry:
{ search: [ 'https://bower.herokuapp.com' ],
register: 'https://bower.herokuapp.com',
publish: 'https://bower.herokuapp.com' },
shorthandResolver: 'git://github.com/{{owner}}/{{package}}.git',
tmp: '/var/folders/tf/rvwhrxms15x20gdxgggsy3zr0000gp/T/jinmatt/bower',
timeout: 30000,
ca: { search: [] },
strictSsl: true,
userAgent: 'node/v0.8.19 darwin x64',
color: true,
storage:
{ packages: '/Users/jinmatt/.cache/bower/packages',
links: '/Users/jinmatt/.local/share/bower/links',
completion: '/Users/jinmatt/.local/share/bower/completion',
registry: '/Users/jinmatt/.cache/bower/registry',
empty: '/Users/jinmatt/.local/share/bower/empty' } }
undefined
node
true
1.2.2
Seems like the version of node v0.8.19 I was running had this problem of setting process.title.
userAgent: 'node/v0.8.19 darwin x64'
Updated node to v0.10.16 stable, and problem solved! Now I get process.title = 'bower'.
@satazor : Just out of curiosity, why was the earlier version of bower working properly? The code wasn't checking for interactive auto, or wasn't checking the process title name?
@jinmatt the default was true, but it has changed to null (auto) later to be more accurate.
This is still an issue when running under Cygwin.
Yep, running into this under Cygwin shell.
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 under mintty.exe, but true if you run cygwin.bat (which is bash --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: https://code.google.com/p/mintty/issues/detail?id=56
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 http://blog.jaykanakiya.com/terminal-setup-in-windows-7/ and/or http://buildstarted.com/2012/05/11/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 to C:\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.
Does not work with cygwin. Tried bower init firstly, then bower init --config.interactive.
$ bower init --config.interactive
bower error Cannot read property 'substring' of undefined
Stack trace:
TypeError: Cannot read property 'substring' of undefined
at Interface.rl._getCursorPos (C:\Program Files\nodejs\node_modules\bower\no de_modules\inquirer\node_modules\readline2\index.js:51:51)
at ScreenManager.render (C:\Program Files\nodejs\node_modules\bower\node_mod ules\inquirer\lib\utils\screen-manager.js:19:27)
at Prompt.render (C:\Program Files\nodejs\node_modules\bower\node_modules\in quirer\lib\prompts\input.js:75:15)
at Prompt._run (C:\Program Files\nodejs\node_modules\bower\node_modules\inqu irer\lib\prompts\input.js:49:8)
at Prompt.run (C:\Program Files\nodejs\node_modules\bower\node_modules\inqui rer\lib\prompts\base.js:57:8)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\bower\node_modul es\inquirer\lib\ui\prompt.js:84:12)
at module.exports (C:\Program Files\nodejs\node_modules\bower\node_modules\i nquirer\node_modules\run-async\index.js:15:21)
at AnonymousObservable.__subscribe (C:\Program Files\nodejs\node_modules\bow er\node_modules\inquirer\lib\utils\utils.js:16:7)
at AnonymousObservable.tryCatcher (C:\Program Files\nodejs\node_modules\bowe r\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:63:31)
at setDisposable (C:\Program Files\nodejs\node_modules\bower\node_modules\in quirer\node_modules\rx-lite\rx.lite.js:5741:44)
Console trace:
Error
at StandardRenderer.error (C:\Program Files\nodejs\node_modules\bower\lib\re nderers\StandardRenderer.js:82:37)
at Logger.<anonymous> (C:\Program Files\nodejs\node_modules\bower\bin\bower: 110:22)
at emitOne (events.js:77:13)
at Logger.emit (events.js:169:7)
at Logger.emit (C:\Program Files\nodejs\node_modules\bower\node_modules\bowe r-logger\lib\Logger.js:29:39)
at C:\Program Files\nodejs\node_modules\bower\lib\commands\index.js:48:20
at _rejected (C:\Program Files\nodejs\node_modules\bower\node_modules\q\q.js :844:24)
at C:\Program Files\nodejs\node_modules\bower\node_modules\q\q.js:870:30
at Promise.when (C:\Program Files\nodejs\node_modules\bower\node_modules\q\q .js:1122:31)
at Promise.promise.promiseDispatch (C:\Program Files\nodejs\node_modules\bow er\node_modules\q\q.js:788:41)
System info:
Bower version: 1.6.7
Node version: 4.1.2
OS: Windows_NT 10.0.10240 x64
Trying bower init in Cygwin and getting
bower ENOINT Register requires an interactive shell
I've also tried bower init --config.interactive and getting
bower EINVAL EINVAL, invalid argument
This is on Windows 10 while running Cygwin as Administrator.
+1 same here when using cygwin shell. In cmd all works fine.
danila.shutov@o109 ~/lab/faith/client
$ bower init
bower ENOINT Register requires an interactive shell
Additional error details:
Note that you can manually force an interactive shell with --config.interactive
danila.shutov@o109 ~/lab/faith/client
$ bower init --config.interactive
bower error Cannot read property 'substring' of undefined
Stack trace:
TypeError: Cannot read property 'substring' of undefined
at Interface.rl._getCursorPos (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\node_modules\readline2\index.js:51:51)
at ScreenManager.render (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\utils\screen-manager.js:19:27)
at Prompt.render (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\prompts\input.js:75:15)
at Prompt._run (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\prompts\input.js:49:8)
at Prompt.run (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\prompts\base.js:57:8)
at Object.<anonymous> (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\ui\prompt.js:84:12)
at module.exports (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\node_modules\run-async\index.js:15:21)
at AnonymousObservable.__subscribe (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\utils\utils.js:16:7)
at AnonymousObservable.tryCatcher (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:63:31)
at setDisposable (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:5741:44)
Console trace:
Error
at StandardRenderer.error (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\lib\renderers\StandardRenderer.js:83:37)
at Logger.<anonymous> (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\bin\bower:116:30)
at emitOne (events.js:77:13)
at Logger.emit (events.js:169:7)
at Logger.emit (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\bower-logger\lib\Logger.js:29:39)
at C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\lib\commands\index.js:48:20
at _rejected (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:844:24)
at C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:870:30
at Promise.when (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:1122:31)
at Promise.promise.promiseDispatch (C:\Users\danila.shutov\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:788:41)
System info:
Bower version: 1.7.1
Node version: 4.2.1
OS: Windows_NT 10.0.10240 x64
I've tried to downgrade the version to bower 0.10.0 but it doesn't work well. The bower init configuration works fine for few seconds then it hangs up your terminal. The solution is found in on its documentation. It's not supporting MinTTY which causes this problem.
Here is the solution:
Thank you dreamypixy. It's so sad cuz i like MinTTY.
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.
Thanks a lot cataquil. But it's still half desicion.
I have the same problem :cry: with Git Bash, but it works well with cmd
I'm having this problem with bower in cygwin. This used to work some time ago, but for some reason it stopped after upgrading to the latest version.
If you are using windows run bower init using CMD
OR
if you are using git bash follow these steps:
Hi, I encounter this bug too. When i use git bash,i encounter the seem issue。so i use windows cmd and fixed out this issue。 so if you os is windows,may be you can use cmd in place of git bash。
@IshanDemon
running 'bower init' works on windows cmd (but did not work with git bash command line for a mysterious reason).
thanks!
i met it today。the way i slove it is using windows cmd instead of git bash.It worked!
enjoy it. buddy
This is still an issue w/ bower 1.8.0 on git version 2.10.1.windows.1
Using cmd over git bash is not a fix,... it's a step backwards.
Will try some of the following solutions mentioned above and report back.
Getting the same issue: Register requires an interactive shell.
I still get error "Register requires an interactive shell" with git version 2.10.2.windows.1
and bower version 1.8.0.
Same here as @Kranthi1547 . However, works in PowerShell.
(Win10Pro64, Git v2.11.1, Bower v1.8.0).
Most helpful comment
@IshanDemon
running 'bower init' works on windows cmd (but did not work with git bash command line for a mysterious reason).
thanks!