Skip to content

bower init failing to bring the interactive prompt to create bower.json #802

@jinmatt

Description

@jinmatt

After updating bower to 1.2.1, the bower init command seems to fail. When running the bower init the follow result is shown:

  • bower ENOINT Register requires interactive

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

Activity

satazor

satazor commented on Aug 20, 2013

@satazor
Member

Hey @jinmatt!

  1. What terminal are you using?
  2. Are you using bower through a regular install (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.

jinmatt

jinmatt commented on Aug 20, 2013

@jinmatt
Author

@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

satazor

satazor commented on Aug 20, 2013

@satazor
Member

@jinmatt I've tried oh-my-zsh and it works. Can you try to uninstall bower and install it again?

jinmatt

jinmatt commented on Aug 20, 2013

@jinmatt
Author

Tried that, but getting the same result again.

jinmatt

jinmatt commented on Aug 20, 2013

@jinmatt
Author

Uninstalled bower 1.2.1 and installed 0.10.0, and now bower init is working.

satazor

satazor commented on Aug 20, 2013

@satazor
Member

@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.

satazor

satazor commented on Aug 20, 2013

@satazor
Member

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?

satazor

satazor commented on Aug 21, 2013

@satazor
Member

Bump.

jinmatt

jinmatt commented on Aug 21, 2013

@jinmatt
Author

@satazor
the output I get:

> var tty = require('tty');
undefined
> tty.isatty(1);
true
jinmatt

jinmatt commented on Aug 21, 2013

@jinmatt
Author

@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?

jinmatt

jinmatt commented on Aug 21, 2013

@jinmatt
Author

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

satazor

satazor commented on Aug 21, 2013

@satazor
Member

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:

jinmatt

jinmatt commented on Aug 21, 2013

@jinmatt
Author

Done:

➜  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

30 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @derekgreer@jinmatt@chasetec@satazor@leotm

        Issue actions

          bower init failing to bring the interactive prompt to create bower.json · Issue #802 · bower/bower