Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Auto install dependencies #32

Merged
merged 1 commit into from

6 participants

@sindresorhus

Many users have voiced concern of there being too many commands to get started. The original intention of not automatically installing deps after scaffolding was for clearity of what was happening. Since users would think a npm bug was a bug with Yeoman. Seeing as this has helped nothing, and people keep opening invalid issues like crazy, I don't think that is an argument anymore.

After thinking about this for a while, I've come to the conclusion that we can do both clearity and ease of use, by doing it automatically, but being totally clear about it. That means showing a clear message as shown below and documenting it. After all, Yeoman is about making front-end development less painful.

@addyosmani @sleeper @btford @passy wdyt?

this also parallizes both commands, so it's faster than before.

Screen Shot 2013-03-17 at 16 04 58

@passy
Owner

I've been thinking about this myself and had the same concerns that users could presume errors in the process would be caused by yeoman. I think this is a very elegant solution to that problem.

app/index.js
@@ -25,7 +26,9 @@ function AppGenerator(args, options, config) {
this.mainCoffeeFile = 'console.log "\'Allo from CoffeeScript!"';
this.on('end', function () {
- console.log('\nI\'m all done. Just run ' + 'npm install && bower install'.bold.yellow + ' to install the required dependencies.');
+ console.log('\n\nI\'m all done. Running ' + 'npm install &; bower install'.bold.yellow + ' for you to install the required dependencies. If this fails, try running the command yourself.\n\n');
@passy Owner
passy added a note

Should be just npm install & bower install. The semicolon there is a syntax error, if I'm not mistaken.

@sindresorhus Owner

You were the one that suggested that syntax.

@passy Owner
passy added a note

I know. :persevere: Searching for the other occurrences right now.

@passy Owner
passy added a note

It works in fish, but not in bash.

@sindresorhus Owner

whatever, npm install & bower install is one char shorter, so why not. Also Bash sucks.

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

the ping machine pings @addyosmani @sleeper @btford ping pong pang

// @paulirish @kevva

@kevva kevva referenced this pull request
Closed

glyphicons-halflings 404 #24

@btford
Owner

I like it. Make it so!

@kevva
Collaborator

Pong, looks good! One could argue that the error output by npm and bower should be enough to make a distinction between those and yeoman. Also, parallelizing is a big plus.

@sindresorhus
Owner

@addyosmani @paulirish last chance to object ;)

@btford
Owner

No objections. Do it.

@btford btford referenced this pull request in yeoman/generator-angular
Closed

Auto install dependencies #143

@addyosmani
Owner

I'm 100% behind this change. We should definitely do it.

@addyosmani
Owner

PS: We need to make sure that if/when this lands we update all of the installation guides for relevant generators as the CLI will be providing instructions for the two steps we're aiming to automate here.

@sindresorhus sindresorhus merged commit 0e07cb4 into master
@sindresorhus sindresorhus deleted the auto-run-postinstall branch
@sindresorhus sindresorhus referenced this pull request in yeoman/yeoman
Closed

Improve performance #944

3 of 9 tasks complete
@passy
Owner

Yeah! :space_invader:

@sindresorhus sindresorhus referenced this pull request in yeoman/yeoman
Closed

Update docs ref auto install of deps change #1007

@yveslaroche

I get the following error after running "yo webapp" now on Windows using the Git Bash.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:977:11)
    at Process.ChildProcess._handle.onexit (child_process.js:768:34)

However, running "npm install & bower install" manually works just fine.

@sindresorhus
Owner

@yveslaroche can you gist your full terminal output? what Node version?

@passy @kevva can you test?

@yveslaroche

I'm using node.js v0.10.3. My full terminal output is here: https://gist.github.com/yveslaroche/5337427

I've also linked in the "generator" repo with the "generator-webapp", as it is a dependency there is well. This step is missing from the contributing instructions. I noticed this because I had the following error before, which was fixed with the latest commit to the generator.

D:\Dropbox\Dev\GitHub\yeoman\generator-webapp\node_modules\yeoman-generator\node
_modules\bower\node_modules\tmp\lib\tmp.js:219
    throw err;
          ^
Error: spawn ENOENT
    at errnoException (child_process.js:977:11)
    at Process.ChildProcess._handle.onexit (child_process.js:768:34)
@kevva
Collaborator

@yveslaroche, try clearing your bower cache and make sure you've got the latest version of bower. May be related to bower/bower#307.

@yveslaroche

@kevva I've cleared bower cache before. And just tried it again with bower v0.8.6 and the latest bower master branch, too. I'm still getting the same error https://gist.github.com/yveslaroche/5337427 with both bower versions.

@yveslaroche yveslaroche referenced this pull request in yeoman/yeoman
Closed

Windows Support #216

@addyosmani
Owner

hmm. Haven't been able to reproduce. Anyone else have better luck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 17, 2013
  1. @sindresorhus
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 app/index.js
View
5 app/index.js
@@ -1,6 +1,7 @@
'use strict';
var util = require('util');
var path = require('path');
+var spawn = require('child_process').spawn;
var yeoman = require('yeoman-generator');
@@ -25,7 +26,9 @@ function AppGenerator(args, options, config) {
this.mainCoffeeFile = 'console.log "\'Allo from CoffeeScript!"';
this.on('end', function () {
- console.log('\nI\'m all done. Just run ' + 'npm install && bower install'.bold.yellow + ' to install the required dependencies.');
+ console.log('\n\nI\'m all done. Running ' + 'npm install & bower install'.bold.yellow + ' for you to install the required dependencies. If this fails, try running the command yourself.\n\n');
+ spawn('npm', ['install'], { stdio: 'inherit' });
+ spawn('bower', ['install'], { stdio: 'inherit' });
});
this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
Something went wrong with that request. Please try again.