yeoman / generator-bootstrap

Yeoman generator for Bootstrap
http://yeoman.io
186 stars 40 forks source link

Generator not working #42

Open PatrickJGabriel opened 8 years ago

PatrickJGabriel commented 8 years ago

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?

SBoudrias commented 8 years ago

Nothing is outputted?

PatrickJGabriel commented 8 years ago

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.

SBoudrias commented 8 years ago

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.

PatrickJGabriel commented 8 years ago

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.

SBoudrias commented 8 years ago

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

NuroDev commented 8 years ago

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

dawndiy commented 7 years ago

run npm install -g bower first will fix this.

osmarpetry commented 7 years ago

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

SBoudrias commented 7 years ago

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

osmarpetry commented 7 years ago

@SBoudrias thank you

emilianos commented 7 years ago

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

osmarpetry commented 7 years ago

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