generator-bootstrap icon indicating copy to clipboard operation
generator-bootstrap copied to clipboard

Generator not working

Open PatrickJGabriel opened this issue 8 years ago • 12 comments

Hello, I am not entirely sure what the issue is, but after running

yo bootstrap

and getting the subsequent menu to choose between CSS, SASS & LESS for my project, no matter which one I choose it doesn't seem to run. I'm in the directory in which I want yo to scaffold to, then run the command, yet nothing happens. Is there something I should be doing that i'm not?

PatrickJGabriel avatar May 19 '16 18:05 PatrickJGabriel

Nothing is outputted?

SBoudrias avatar May 19 '16 18:05 SBoudrias

No, nothing at all. I have tried other generators to see if it was possibly my yo install in general that was the problem but my angular generator worked just fine.

PatrickJGabriel avatar May 19 '16 18:05 PatrickJGabriel

Okay, well maybe that generator is broken, we haven't touched the core of it in ~ 2 years.

Basically no one stepped up to be the maintainer of it.

SBoudrias avatar May 19 '16 18:05 SBoudrias

Ah I see, on the yeoman website it says the generator was updated 6 months ago, but I see now here on Github that it was last update Nov of 2015. Well that's okay, thank you very much.

PatrickJGabriel avatar May 19 '16 18:05 PatrickJGabriel

Let's keep open. We/someone should fix it.

SBoudrias avatar May 19 '16 18:05 SBoudrias

Agreed. Also getting this. Fresh install and generates no content at all.

NuroDev avatar Jul 25 '16 03:07 NuroDev

run npm install -g bower first will fix this.

dawndiy avatar Feb 08 '17 08:02 dawndiy

@SBoudrias could I add the following line of code, in ./generator-bootstrap/app/index.js to check if bower is installed?

   try {
    require.resolve('bower');
  } catch (e) {
    console.error('Bower is not found! Run "npm install -g bower"');
    process.exit(e.code);
  }
  // map format -> package name
  var packages = {
    css: 'bootstrap',
    sass: 'bootstrap-sass-official',
    less: 'components-bootstrap',
    stylus: 'bootstrap-stylus'
  };

  this.bowerInstall(packages[this.format], { save: true });
};

Or maybe just add the bower inside the package.json

  "name": "generator-bootstrap",
  "version": "0.2.2",
  "description": "Yeoman generator for Bootstrap",
  "keywords": [
    "yeoman-generator",
    "framework",
    "component",
    "bootstrap",
    "ui",
    "css",
    "sass",
    "less"
  ],
  "author": "The Yeoman Team",
  "repository": "yeoman/generator-bootstrap",
  "scripts": {
    "test": "mocha"
  },
  "dependencies": {
    "bower": "^1.8.0",
    "yeoman-generator": "^0.18.9"
  },
  "devDependencies": {
    "mocha": "^2.3.3"
  },
  "license": "BSD-2-Clause"
}

I'm asking because I never did it before.

osmarpetry avatar Feb 18 '17 17:02 osmarpetry

@osmarpetry global modules are not require()able in Node. As such, this wouldn't fix the issue.

SBoudrias avatar Feb 19 '17 03:02 SBoudrias

@SBoudrias thank you

osmarpetry avatar Feb 20 '17 01:02 osmarpetry

I'm having the same issue, how did you solve this?

emilianos avatar Mar 13 '17 12:03 emilianos

@emilianos If you're using Mac or Linux type on terminal "sudo npm install -g bower" If you're on Windows start de CMD as administrator and type "npm install -g bower"

osmarpetry avatar Mar 16 '17 20:03 osmarpetry