Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Auto install dependencies #32

Merged
merged 1 commit into from about 1 year ago

6 participants

Sindre Sorhus Pascal Hartig Brian Ford Kevin Mårtensson Addy Osmani Yves Laroche
Sindre Sorhus
Owner

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

Pascal Hartig
Owner
passy commented March 17, 2013

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) {
25 26
   this.mainCoffeeFile = 'console.log "\'Allo from CoffeeScript!"';
26 27
 
27 28
   this.on('end', function () {
28  
-    console.log('\nI\'m all done. Just run ' + 'npm install && bower install'.bold.yellow + ' to install the required dependencies.');
  29
+    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');
5
Pascal Hartig Owner
passy added a note March 17, 2013

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

Sindre Sorhus Owner

You were the one that suggested that syntax.

Pascal Hartig Owner
passy added a note March 17, 2013

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

Pascal Hartig Owner
passy added a note March 17, 2013

It works in fish, but not in bash.

Sindre Sorhus 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
Sindre Sorhus
Owner

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

// @paulirish @kevva

Kevin Mårtensson kevva referenced this pull request March 22, 2013
Closed

glyphicons-halflings 404 #24

Brian Ford
Owner

I like it. Make it so!

Kevin Mårtensson
Collaborator
kevva commented March 23, 2013

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.

Sindre Sorhus
Owner

@addyosmani @paulirish last chance to object ;)

Brian Ford
Owner

No objections. Do it.

Brian Ford btford referenced this pull request in yeoman/generator-angular April 06, 2013
Closed

Auto install dependencies #143

Addy Osmani
Owner

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

Addy Osmani
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.

Sindre Sorhus sindresorhus merged commit 0e07cb4 into from April 07, 2013
Sindre Sorhus sindresorhus closed this April 07, 2013
Sindre Sorhus sindresorhus deleted the branch April 07, 2013
Sindre Sorhus sindresorhus referenced this pull request in yeoman/yeoman April 07, 2013
Open

Improve performance #944

3 of 9 tasks complete
Pascal Hartig
Owner
passy commented April 07, 2013

Yeah! :space_invader:

Sindre Sorhus sindresorhus referenced this pull request in yeoman/yeoman April 07, 2013
Closed

Update docs ref auto install of deps change #1007

Yves Laroche

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.

Sindre Sorhus
Owner

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

@passy @kevva can you test?

Yves Laroche

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)
Kevin Mårtensson
Collaborator
kevva commented April 08, 2013

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

Yves Laroche

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

Yves Laroche yveslaroche referenced this pull request in yeoman/yeoman April 09, 2013
Closed

Windows Support #216

Addy Osmani
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

Showing 1 unique commit by 1 author.

Mar 17, 2013
Sindre Sorhus Auto install dependencies 935488b
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  app/index.js
5  app/index.js
... ...
@@ -1,6 +1,7 @@
1 1
 'use strict';
2 2
 var util = require('util');
3 3
 var path = require('path');
  4
+var spawn = require('child_process').spawn;
4 5
 var yeoman = require('yeoman-generator');
5 6
 
6 7
 
@@ -25,7 +26,9 @@ function AppGenerator(args, options, config) {
25 26
   this.mainCoffeeFile = 'console.log "\'Allo from CoffeeScript!"';
26 27
 
27 28
   this.on('end', function () {
28  
-    console.log('\nI\'m all done. Just run ' + 'npm install && bower install'.bold.yellow + ' to install the required dependencies.');
  29
+    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');
  30
+    spawn('npm', ['install'], { stdio: 'inherit' });
  31
+    spawn('bower', ['install'], { stdio: 'inherit' });
29 32
   });
30 33
 
31 34
   this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.