yeoman / yo Goto Github PK
View Code? Open in Web Editor NEWCLI tool for running Yeoman generators
Home Page: http://yeoman.io
License: BSD 2-Clause "Simplified" License
CLI tool for running Yeoman generators
Home Page: http://yeoman.io
License: BSD 2-Clause "Simplified" License
I generated webapp using yo command.
If i run the grunt server, then i can access the server using localhost:9000
But if i access through ip address like 192.141.1.22:9000, it does not work.
FYI: Old Yeoman works well in both cases.
I think a nice workflow could look like:
$ mkdir angular-app && cd $_
$ yo
What type of application would you like to create?
[x] Angular
[ ] Backbone
[ ] Update your generators
[ ] Install a generator
[ ] Find help
[ ] Get me out of here!
Would you like to ___ ? (Y/n) Yes
Would you like ___? (y/N) No
I am now installing a bunch of stuff that will make you happy . . . . . . . .
Bye from us!
$ yo
What would you like to do?
[ ] Create a service
[x] Create a directive
[ ] Add features to your project
[ ] Back to the main menu
What would you like to call the directive? shoop-a-doop
Done! Anything else?
[ ] Create a service
[ ] Create a directive
[x] Add features to your project
[ ] Back to the main menu
Here are some things you can drop into your project. Note that these
might require additional configuration.
[x] CoffeeScript
[ ] PhantomJS
[ ] grunt-modernizr
[ ] Nevermind
... Installing required dependencies ...
Affected files:
> M Gruntfile.js
> A app/scripts/main.coffee
We've successfully dropped in CoffeeScript! Would you like anything else?
[ ] PhantomJS
[ ] grunt-modernizr
[ ] Nevermind
As Sindre taught me, hiding the technology underneath a prompt in this manner isn't ideal, as it doesn't help a developer learn their craft. However, it would be darn cool to let users interact with Yo this way. I just wanted to throw this out there to get feedback/inspire ideas and discussion.
I personally find the yo generator:subgenerator Something --but-not-this
style non-optimal. Before I understood the difference between yo, a generator, and a subgenerator, I couldn't remember that syntax for the life of me. There are ways to get help (readmes, usage), but it still creates an undesirable delay. In the end, yo generator:subgenerator Something
just isn't pretty. It might just be me, but I think just saying yo
for scaffolding, using a subgenerator, installing something, getting help, etc. would be much more interactive, friendly, and awesome.
Cannot grunt my app :
Running "imagemin:dist" (imagemin) task
Error: /home/damaru/htdocs/marc/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/vendor/linux/x64/jpegtran: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /home/damaru/htdocs/marc/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/vendor/linux/x64/jpegtran)
on debian wheezy...
Can I disable the imagemin from grunt?
Hi all
Are these important
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"})
everything else appears fine but these
I was using node v0.8.x but had to switch to node v0.10.2 there are v.0.8 dependencies on a new install - I was having trouble using the new generator generator
refer to
Medium/phantomjs#63
nvm use v0.10.2
npm install -g yo
tks
M
Since #36 is landed I thought of trying yo yo
.
$ yo
results
But when I pressed down arrow to select backbone it results
yo : master branch
generator : master branch
OS : ubuntu 12.04
@stephenplusplus Great work with yo yo. kudos.
I just installed yo grunt-cli and bower.
First time running the command yo gave me this:
$ yo webapp ========================================================================== We're constantly looking for ways to make yo better! May we anonymously report usage statistics to improve the tool over time? More info: yeoman.io/insight.html & http://yeoman.io ========================================================================== [?] [Y/n]: (Y) Y /usr/local/lib/node_modules/bower/node_modules/tmp/lib/tmp.js:219 throw err; ^ Error: Cannot find module 'isBinaryFile' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at Object. (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/actions/actions.js:8:20) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17)
Running bower commands works.
node -v 0.8.20
npm -v 1.2.10
I've run the following commands after installing yo, grunt-cli and bower.
npm install generator-angular generator-testacular yo angular npm install & bower install grunt server
And I'm getting this error
Running "clean:server" (clean) task Running "coffee:dist" (coffee) task >> Destination not written because compiled files were empty. Running "compass:server" (compass) task Errno::ENOENT on line ["33"] of /home/paulo/.rvm/gems/ruby-1.9.3-p392/gems/compass-0.12.2/lib/compass/exec/global_options_parser.rb: No such file or directory - /components Run with --trace to see the full backtrace Running "livereload-start" task ... Starting Livereload server on 35729 ... Running "connect:livereload" (connect) task Starting connect web server on localhost:9000. Running "open:server" (open) task Running "watch" task Watching /scripts/*.coffee Watching test/spec/*.coffee Watching /styles/*.{scss,sass} Watching /*.html,/*/*.html,{.tmp,}/styles/*.css,{.tmp,}/scripts/*.js,{.tmp,}/scripts/*/*.js,/images/*.{png,jpg,jpeg} Fatal error: EACCES, readdir '/lost+found'
node -v 0.8.20
npm -v 1.2.10
I am not sure I am doing something wrong here, but when running grunt to create the dist/ it won't copy the components folder from the /app/. This is something that used to happen with yeoman previously, not sure if i'm missing something in the workflow.
I created a simple webapp project :
yo webapp
npm install && bower install
bower install threejs
grunt test
grunt
all goes without error, but with a quite slim /dist/ folder.
Two issues:
yo --help
command is ignored. This is due to https://github.com/yeoman/yo/blob/master/bin/yo#L87 and is easily solved by moving the help conditional above the yoyo commandHi guys,
while working on a yeoman based project I updated to 1.0.0-beta.4 (via npm update -g yo)
Currently it is not possible to use yo webapp โ should be related to #21.
Wouldn't it make sense to use a develop branch for such work in progress?
Note: I haven't performed all manual steps from https://github.com/yeoman/yeoman/blob/master/contributing.md
Would be an nice UX improvement to let users know when an update to their favorite generators are available. >=patch releases.
Should be lazily loaded, since it's a slow action.
I think it would make sense to move the part that finds and runs generators into yo, while leaving the generator system to be consumed by each generator.
This would reduce complexity and making the dependency consumed by every generator smaller and faster.
yo
could still be consumed programmatically as the current generator system is able to.
Let's discuss how we could do this.
yo 1.0.0-rc.1
OSX 10.8.3
I'm obtaining SyntaxError: Unexpected token <
using the feature "Install a generator".
I'm behind a proxy and the request to http://isaacs.iriscouch.com/registry/_design/app/_view/byKeyword?startkey=[%22yeoman-generator%22]&endkey=[%22yeoman-generator%22,{}]&group_level=3'
in _findAllNpmGenerators is not served correctly.
Therefore JSON.parse() fails.
Any idea on how handle this type of errors in order to have a better UX?
I've recently installed yo with sudo npm -g install yo
I ran into the problem that npm creates the ~/tmp and ~/.npm as root. So later running yo webapp
failed because yo couldn't write into tmp/.
I don't know if this is related to yo itself. But was a little bit tricky figuring it out.
At first i did this:
[?] What would you like to do? Install a generator
[?] Search NPM for generators: travis
[?] Here's what I found. Install one? generator-travis-ci
Which resulted in this
I just installed your generator by running:
npm install -g generator-travis-ci
Then yo asked me again what I wanted to do. Here i expected the newly installed generator to be present in the list, but it wasnt! The prompt only showed me this:
[?] What would you like to do? (Use arrow keys)
โฏ Run the Angular generator (0.3.1)
Update your generators
Install a generator
Find some help
Get me out of here!
I had to restard yo and then it showed me the newly installed generator:
[?] What would you like to do? (Use arrow keys)
โฏ Run the Angular generator (0.3.1)
Run the Travis-ci generator (0.6.3)
Update your generators
Install a generator
Find some help
Get me out of here!
It would be nice if the prompt updated itself after generator install :)
Just needs some simple test to make sure it work. Most of the needed tests are in the generator repo.
I'm running
I know there's a warning about using this version on Windows, I'm just trying to help.
What I get is
[...]
I'm all done. Running npm install & bower install for you to install the required >dependencies. If this fails, try running the command yourself.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)
It always fails, doesn't matter which generator I'm using. at first I thought it was a generator-angular problem but I can see the generator is working fine, what fails is yo itself.
it doesn't seem to have any side effects though, it doesn't affect the task completion.
I create test webapp, add app/styles/scss/base.scss
then run grunt build and it produce:
Running "compass:dist" (compass) task
Error: invalid option: --fonts-dir
Usage: compass compile [path/to/project] [path/to/project/src/file.sass ...] [options]
Description:
compile project at the path specified or the current director if not specified.
but fonts directory exists in app/styles/fonts
Just uppercasing the first character doesn't look that good in some cases. Like with the H5BP generator.
Generators supports a name property: https://github.com/h5bp/generator-h5bp/blob/master/app/index.js#L39
Use that in yoyo if it exists.
Before: Run the H5bp generator
After: Run the HTML5 Boilerplate generator
Maybe we should enforce generators to set a humanized name?
To get started, using:
http://yeoman.io/gettingstarted_1.0.html
I run the following
npm install -g yo grunt-cli bower
when I then try:
yo webapp
I get:
yo: command not found
Poking around, I find that yo is at:
/usr/local/share/npm/lib/node_modules/yo
Can there be either a command or just output somewhere the version of the generators instead of just the listing of them? This would help with helping to troubleshoot.
It would be good to have a CLI flag to permanently opt out of insight tracking. This would allow people to install yo
as part of a larger setup script, and be sure that any requirements to not be tracked are met (e.g., in corporate settings or users who have privacy concerns). For example:
# other stuff
npm install -g yo
yo --disable-insight
# other stuff
The existing --no-insight
runtime flag is not sufficient, and I don't want to rely on the prompt (which defaults to "yes") as it can't be guaranteed that people installing yo
will opt out of tracking.
It might be better to repurpose the --no-insight
flag to be a permanent opt-out. But then you might also want to provide the option to easily reverse, which is why I was thinking of --disable|enable-insight
flag names.
Here is error from log:
10366 verbose rebuildBundles [email protected]
10367 verbose rebuildBundles [ 'colors',
10367 verbose rebuildBundles 'yeoman-generator',
10367 verbose rebuildBundles 'generator-mocha',
10367 verbose rebuildBundles 'insight',
10367 verbose rebuildBundles 'generator-webapp',
10367 verbose rebuildBundles 'lodash',
10367 verbose rebuildBundles 'nopt',
10367 verbose rebuildBundles 'update-notifier',
10367 verbose rebuildBundles '.bin' ]
10368 info /usr/lib/node_modules/yo unbuild
10369 verbose from cache /usr/lib/node_modules/yo/package.json
10370 info preuninstall [email protected]
10371 info uninstall [email protected]
10372 verbose true,/usr/lib/node_modules,/usr/lib/node_modules unbuild [email protected]
10373 verbose /usr/bin,[object Object] binRoot
10374 info postuninstall [email protected]
10375 error Error: ENOENT, chmod '/usr/lib/node_modules/yo/bin/yo'
10376 error If you need help, you may report this log at:
10376 error http://github.com/isaacs/npm/issues
10376 error or email it to:
10376 error [email protected]
10377 error System Linux 3.2.0-38-generic
10378 error command "nodejs" "/usr/bin/npm" "install" "-g" "yo"
10379 error cwd /home/xxx
10380 error node -v v0.8.18
10381 error npm -v 1.2.2
10382 error path /usr/lib/node_modules/yo/bin/yo
10383 error code ENOENT
10384 error errno 34
10385 verbose exit [ 34, true ]
Installing previous version "sudo npm install -g [email protected]" works fine, so problem is in latest version.
Yeoman (npm install -g yoyo) is noisy. Loud in fact. Although, on my secondary machine, I noticed it didn't fail very clearly when grunt-cli
(GruntJS) was missing. Why not? You guys have done some great work, keep it up ๐
I stumbled upon this StackOverflow answer to solve my environment issue. Can we automate it? http://stackoverflow.com/a/14953653/320399
Just install the latest version and when I try to "yo angular" or any other package I get the following error:
Error angular
Invalid namespace: angular (or not yet registered).
Registered: 4 namespace(s). Run with the --help
option to list them.
Updated you can close this:
Sorry did not realize you had to first install "npm install generator-angular ". I missed that on the yeoman webpage.
https://gist.github.com/tomlane/4956581
after default install command of "npm install -g grunt-cli yo bower" on windows.
yeoman wanted bower ~0.9.2
, but bower
has already upgraded to 0.10.0
or so.
so, where fresh run the command in doc:
npm install -g yo grunt-cli bower
there would be an error like this:
npm ERR! peerinvalid The package bower does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants bower@~0.9.2
npm ERR! System Darwin 12.4.0
npm ERR! command "/usr/local/Cellar/node/0.10.12/bin/node" "/usr/local/bin/npm" "install" "-g" "yo" "grunt-cli" "bower"
npm ERR! cwd /usr/local/Library/Formula
npm ERR! node -v v0.10.12
npm ERR! npm -v 1.2.32
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/Library/Formula/npm-debug.log
npm ERR! not ok code 0
my work around:
npm install -g yo grunt-cli [email protected]
so, i think, maybe update the doc for this? or, upgrade yo to meet the new bower
?
I've been thinking a yo yo
command, or maybe simply yo --help
that does the following would be nice:
$ yo yo
Yo yo! What can I do for you?
[a] Update your generators
[b] Install a generator
[c] Find you some help
a (update your generators)
# finds installed generators, updates
You're all set! Is there anything else I can get you?
[a] Update your generators
[b] Install a generator
[c] Find you some help
b (install a generator)
Great! Here are some generators you may like:
# (doesn't include installed generators)
[a] angular
[b] ember
[c] other
c
What would you like to search for?
blog
I have a `generator-weblog`, by stephenplusplus, last updated May 12th, 2013.
Would you like to install it? y
Done! Anything else?
[a] Update your generators
[b] Install a generator
[c] Find you some help
c (find you some help)
It's my job to assure we have a splendid experience together. What can I do to help?
[a] Take me to the Documentation
[b] View Frequently Asked Questions
[c] File an issue on GitHub
It's just an idea that still needs fleshing out. Just wanted to see if there were any thoughts before I go further :)
Instructions from: http://addyosmani.com/blog/yeoman-update-announcing-1-0-beta-4/
Jolantas-MacBook-Air:Seconds misio$ yo --version
1.0.0-beta.3
Jolantas-MacBook-Air:Seconds misio$ npm update -g yo
Jolantas-MacBook-Air:Seconds misio$ yo --version
1.0.0-beta.3
Jolantas-MacBook-Air:Seconds misio$
Is there anything obvious I am missing here?
Main reason to upgrade:
Yeoman generators can now be optionally installed globally
EDIT: updated Wiki here: https://github.com/yeoman/yeoman/wiki/Getting-Started#scaffolding-an-angularjs-app
Run yo without specifying a generator name
$ yo
then select the generator to use. The following error message is display and the process is cancelled.
[?] What would you like to do? Run the Webapp generator (0.2.2)
Before you create a new application,
be sure you are running this command
from the directory you wish your application to be dropped into.
Error
Must provide at least one argument, the generator namespace to invoke.
Bye from us! Chat soon.
found in version
$ yo --version
1.0.0-rc.1.2
@tkellen said:
Just dropping a note to mention that you should have a look at node-task. The next version of Grunt will support it, and I think it does much of what you're looking for.
I'm just starting out. I followed the getting started instructions. Installed yo, grunt-cli & bower globally, was able to run yo webapp
and npm install && bower install
successfully. But when I then try to run grunt
with no other changes, I get the following error.
...
Running "mocha:all" (mocha) task
Testing index.html
Running PhantomJS...ERROR
>> In order for this task to work properly, PhantomJS must be installed locally
>> via NPM. If you're seeing this message, generally that means the NPM install
>> has failed. Please submit an issue providing as much detail as possible at:
>> https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found. Use --force to continue.
Aborted due to warnings.
I see that PhantomJS is included as a part of grunt-mocha, and looks to be installed correctly. I have tried cleaning the modules and npm install
ing a number of times.
Additionally, I have tried brew install phantomjs
but that didn't help, and I have since uninstalled from brew.
Thanks.
As discussed I think yoyo should display what command it uses for certain things so the user can learn and do it themselves.
Anything else?
I've been testing yeoman over Windows 7 x64 and I found some quirks and workarounds
The first one affects generator-webapp and is solved by yeoman/generator-webapp#49
generator-angular is also affected by the same issue and should be patched as well by yeoman/generator-angular#153
I've also found that optipng
and jpegtran
fail when executing the inital npm install
. I was able to get them working by installing the Windows binaries for them and making them available in the PATH environment variable.
The jpegtran windows binary is available at http://jpegclub.org/jpegtran/
The optipng windows binary is available at http://optipng.sourceforge.net/
Today, I updated yo
to 1.0.0-rc.1.1
and I really like yo yo.
Great stuff @stephenplusplus.
Unfortunately, I now have the one issue that everything that I type during the prompts is output twice.
Example:
mkdir stuff && cd $_
yo
Everything is fine until I select a generator and the prompts start:
[?] Would you mind telling me your username on Github?: (someuser) ssoommeeuusseerr
In some cases it also happened that the "exit message" (Bye from us etc...) appeared twice, too.
I briefly spoke with @SBoudrias about it, he was able to reproduce it.
Currently I am running:
Hope the above helps, otherwise please let me know. I am also on IRC for another while (although it's 2am here in OZ).
Cheers & thanks
I don't think this is the intention. I have the following in my script/main.js.
require.config({
shim: {
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
underscore: {
exports: '_'
}
},
paths: {
jquery: 'vendor/jquery.min',
underscore: '../components/underscore/underscore-min',
backbone: '../components/backbone/backbone-min'
}
});
require(['app'], function (app) {
'use strict';
console.log(app);
});
It keeps on getting rebuilt as when I run grunt build. My script/main.js becomes the following:
(function(){define("app",[],function(){"use strict";return"Hello from Yeoman!"}),require.config({shim:{backbone:{deps:["underscore","jquery"],exports:"Backbone"},underscore:{exports:"_"}},paths:{jquery:"vendor/jquery.min",underscore:"../components/underscore/underscore-min",backbone:"../components/backbone/backbone-min"}}),require(["app"],function(e){"use strict";console.log(e)}),define("main",function(){})})();
This is from yo 1.0.0-beta.1's Grunt file.
This is my Grunt.js file generated:
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var yeomanConfig = {
app: 'app',
dist: 'dist'
};
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
files: ['test/spec/*.coffee'],
tasks: ['coffee:test']
},
compass: {
files: ['<%= yeoman.app %>/styles/*.{scss,sass}'],
tasks: ['compass']
},
livereload: {
files: [
'<%= yeoman.app %>/*.html',
'{.tmp,<%= yeoman.app %>}/styles/*.css',
'{.tmp,<%= yeoman.app %>}/scripts/*.js',
'<%= yeoman.app %>/images/*.{png,jpg,jpeg}'
],
tasks: ['livereload']
}
},
connect: {
livereload: {
options: {
port: 9000,
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, 'app')
];
}
}
},
test: {
options: {
port: 9000,
middleware: function (connect) {
return [
mountFolder(connect, '.tmp'),
mountFolder(connect, 'test')
];
}
}
}
},
open: {
server: {
url: 'http://localhost:<%= connect.livereload.options.port %>'
}
},
clean: {
dist: ['.tmp', '<%= yeoman.dist %>/*'],
server: '.tmp'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'<%= yeoman.app %>/scripts/*.js',
'test/spec/*.js'
]
},
mocha: {
all: {
options: {
run: true,
urls: ['http://localhost:<%= connect.test.options.port %>/index.html']
}
}
},
coffee: {
dist: {
files: {
'.tmp/scripts/coffee.js': '<%= yeoman.app %>/scripts/*.coffee'
}
},
test: {
files: [{
expand: true,
cwd: '.tmp/spec',
src: '*.coffee',
dest: 'test/spec'
}]
}
},
compass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
cssDir: '.tmp/styles',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: 'app/components',
relativeAssets: true
},
dist: {},
server: {
options: {
debugInfo: true
}
}
},
// not used since Uglify task does concat,
// but still available if needed
/*concat: {
dist: {}
},*/
// Example: https://github.com/jrburke/r.js/blob/master/build/example.build.js
requirejs: {
dist: {
// Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
options: {
// `name` and `out` is set by grunt-usemin
baseUrl: 'app/scripts',
optimize: 'none',
// TODO: Figure out how to make sourcemaps work with grunt-usemin
//generateSourceMaps: true,
// required to support SourceMaps
// http://requirejs.org/docs/errors.html#sourcemapcomments
preserveLicenseComments: false,
useStrict: true,
wrap: true,
//uglify2: {} // https://github.com/mishoo/UglifyJS2
}
}
},
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
dest: 'dist'
},
usemin: {
html: ['<%= yeoman.dist %>/*.html'],
css: ['<%= yeoman.dist %>/styles/*.css']
},
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '*.{png,jpg,jpeg}',
dest: '<%= yeoman.dist %>/images'
}]
}
},
cssmin: {
dist: {
files: {
'<%= yeoman.dist %>/styles/main.css': [
'.tmp/styles/*.css',
'<%= yeoman.app %>/styles/*.css'
]
}
}
},
htmlmin: {
dist: {
options: {
removeCommentsFromCDATA: true,
// https://github.com/yeoman/grunt-usemin/issues/44
//collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeOptionalTags: true
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>',
src: '*.html',
dest: '<%= yeoman.dist %>'
}]
}
},
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,txt}',
'.htaccess'
]
}]
}
},
bower: {
rjsConfig: 'app/scripts/main.js'
}
});
grunt.renameTask('regarde', 'watch');
// remove when mincss task is renamed
grunt.renameTask('mincss', 'cssmin');
grunt.registerTask('server', [
'clean:server',
'coffee:dist',
'compass:server',
'livereload-start',
'connect:livereload',
'open',
'watch'
]);
grunt.registerTask('test', [
'clean:server',
'coffee',
'compass',
'connect:test',
'mocha'
]);
grunt.registerTask('build', [
'clean:dist',
'jshint',
'test',
'coffee',
'compass:dist',
'useminPrepare',
'requirejs',
'concat',
'uglify',
'imagemin',
'cssmin',
'htmlmin',
'copy',
'usemin'
]);
grunt.registerTask('default', ['build']);
};
Hi,
I don't know If this is a grunt related issue or a yeoman related, please correct my otherwise.
I've updated from yeoman to yo etc and everything went fine I can build my project and everything. But besides the port 3501 for the local test server something else must have changed, because since the update I'm not able to access the running instance from another machine on my network, this was possible when I was doing "yeoman sever", but since I do "grunt server" it does not work anymore. Is this a normal behaviour since the update to yeoman 1.0?
Thanks
I had some generators I haven't updated in a while which errored, but it showed me that the generators are registered twice, which is wasteful.
Once when I run yo
and once when I've chosen a generator:
Unable to register generator-jquery/app/index.js (Error: Cannot find module 'yeoman-generator')
Unable to register generator-testacular/app/index.js (Error: Arguments to path.join must be strings)
Unable to register generator-jasmine/lib/generators/app/index.js (Error: Cannot find module 'yeoman-generator')
[?] What would you like to do?: Run the Webapp generator
Before you create a new application, be sure you are running this command
from the directory you wish your application to be dropped into.
Unable to register generator-jquery/app/index.js (Error: Cannot find module 'yeoman-generator')
Unable to register generator-testacular/app/index.js (Error: Arguments to path.join must be strings)
Unable to register generator-jasmine/lib/generators/app/index.js (Error: Cannot find module 'yeoman-generator')
"yo angular" does not support new version of Bootstrap.
Inspired by the bower discussion yesterday (bower/bower#498), I would like to propose the same idea to add a simple check if yo
is run with root permissions and exit in that case with a big fat error message.
I don't think we need an option to override this and should wait for convincing bug reports.
I've tested all the official generators. npm install -g generator-angular
and npm install -g generator-webapp
both fail, but work not global.
...
npm http 304 https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm ERR! Error: ENOENT, open 'C:\Users\Ken\AppData\Roaming\npm'
npm ERR! System Window_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "generator-angular"
npm ERR! cmd C:\Users\Ken\AppData\Roaming\npm
npm ERR! node -v v0.8.18
npm ERR! npm -v 1.2.2
npm ERR! path C:\User\Ken\AppData\Roaming\npm\package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! not ok code 0
I would find it practical to have a mechanism to set default values for fields. For example, my githubUsername
/authorName
rarely change and it would be awesome to have those be pre-filled.
In grunt-init, they allow you to fill out your default overrides in ~/.grunt-init/defaults.json
. I have found it saves me a lot of time and unnecessary re-entry of fields.
Alternatively, there could be a system which allows you to default to the value used last time.
Just executed yo webapp
on a new project, using generator-webapp 0.1.5.
Once done, npm install
fails due to [email protected]
with following errors :
....
npm http 304 https://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/hooker
npm http 304 https://registry.npmjs.org/connect
> [email protected] postinstall /path/to/my/project/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node build.js
> [email protected] postinstall /path/to/my/project/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin
> node build.js
module.js:340
throw err;
^
Error: Cannot find module '/path/to/my/project/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/build.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
As a temporary workaround, I enforced the jpegtran-bin version to 0.1.0 (previous release) in my package.json's devDependencies :
"devDependencies": {
"grunt": "~0.4.0",
"grunt-contrib-copy": "~0.4.0",
"grunt-contrib-concat": "~0.1.2",
"grunt-contrib-coffee": "~0.4.0",
"grunt-contrib-uglify": "~0.1.1",
"grunt-contrib-compass": "~0.1.2",
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-cssmin": "~0.4.1",
"grunt-contrib-connect": "0.1.2",
"grunt-contrib-clean": "0.4.0",
"grunt-contrib-htmlmin": "0.1.1",
"jpegtran-bin": "0.1.0",
"grunt-contrib-imagemin": "0.1.2",
"grunt-contrib-livereload": "0.1.1",
"grunt-bower-hooks": "~0.2.0",
...
Stick to providing a CLI wrapper tool rather than bundling an arbitrary set of opinionated generators with this tool. This should be like grunt-cli and not blur the boundaries.
My OS is mac os 10.8.4.
node version: 0.8.18
npm version: 1.3.1
$ sudo npm install -g [email protected] # works fine
$ sudo npm install -g [email protected] # error occurs!
$ sudo npm install -g [email protected] # error occurs!
$ sudo npm install -g [email protected] # error occurs!
This error only occurs in 1.0.0-beta.5 to 1.0.0-beta.7
Error message
npm ERR! Error: ENOENT, open '/usr/local/lib/package.json'
Hi,
I have a problem with yo on Windows (8). I try to generate an angular app:
C:\Dev\Temp\Yeoman>yo angular
Would you like to include Twitter Bootstrap? (Y/n) y
y
If so, would you like to use Twitter Bootstrap for Compass (as opposed to vanilla CSS)? (Y/n)
Would you like to include angular-resource.js? (Y/n)
I get asked for the Twitter Bootstrap and accept it with Y/Enter, but the second question (Bootstrap with Compass) is accepted instantly too. This also happens with other generators. (webapp: I accept Twitter Bootstrap for Sass and it accepts RequireJS too.)
Maybe I'm doing something wrong, but isn't this the old syntax?
nick.heiner:/tmp/yo-generator-test $ yo generator
path.existsSync is now called `fs.existsSync`.
Usage:
yeoman init NAME [options]
Options:
-h, --help # Print generator's options and usage Default: false
Then I run it with -h
, but that isn't helpful:
nick.heiner:/tmp/yo-generator-test $ yo generator -h
Usage: yo GENERATOR [args] [options]
General options:
-h, --help # Print generator's options and usage
-f, --force # Overwrite files that already exist
Please choose a generator below.
Generator
generator
Mocha
mocha:app
mocha:generator
Webapp
webapp:app
This suggests that a generator named generator
exists, and yo generator
should work, but this is not the case (as seen above).
Am I doing something wrong?
[?] Search NPM for generators:
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at WriteStream.EventEmitter.addListener (events.js:168:15)
at WriteStream.Readable.on (_stream_readable.js:663:33)
at MuteStream.Stream.pipe (stream.js:65:8)
at MuteStream.pipe (/Users/hemanth/.nvm/v0.11.2/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/node_modules/mute-stream/mute.js:83:32)
at Object.Interface.createInterface (/Users/hemanth/.nvm/v0.11.2/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/utils/readline.js:35:6)
at Object.cli.prompt (/Users/hemanth/.nvm/v0.11.2/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/inquirer.js:48:40)
at yoyo.prompt (/Users/hemanth/.nvm/v0.11.2/lib/node_modules/yo/node_modules/yeoman-generator/lib/actions/prompt.js:15:19)
at yoyo._searchNpm (/Users/hemanth/.nvm/v0.11.2/lib/node_modules/yo/bin/yoyo.js:150:8)
at Object.<anonymous> (/Users/hemanth/.nvm/v0.11.2/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/inquirer.js:77:7)
at /Users/hemanth/.nvm/v0.11.2/lib/node_modules/yo/node_modules/async/lib/async.js:229:13
Installed node using nvm
and just hit the return key for [?] Search NPM for generators:
just created a new yo webapp
with sass-boostrap and require.js and I get :
Please note that
tpg requires jquery ~1.9.1
sass-bootstrap requires jquery ~1.8.0
Resolved to jquery v1.9.1, which matches the requirement defined in the project's component.json.
Conflicts may occur.
this is my component.json:
{
"name": "tpg",
"version": "0.0.0",
"dependencies": {
"sass-bootstrap": "~2.3.0",
"requirejs": "~2.1.4",
"modernizr": "~2.6.2",
"jquery": "~1.9.1"
},
"devDependencies": {}
}
I tried to update all my package and run again a new yo webapp
same story.
I see in http://yeoman.io/road.html, the statement "Python, which was slow but required, is gone".
I have been experimenting with yo
on windows, and enjoying it... but had some pain points getting started with the angular and karma generators. In particular, they use node-gyp
, which in turn requires python and MSVC. In my case, I am running 64bit node, so I discovered I needed a 64bit python and an MSVC that can target 64bit. My solution was to use chocolatey to install yeoman. This gets most of the dependencies... but not the compiler.
See my notes here: http://chocolatey.org/packages/Yeoman#comment-898194541
So it seems like Python is still needed. And also VisualStudio2012 (express if you want a free version). I got it installed/working... but it took me a long time. If the dependency on node-gyp and therefore python and a MSVC compiler were removed, then this would save a lot of effort... Or the chocolatey package could be updated. (I sent some notes to the chocolatey package owner.)
As a side note: I am also a vim user... and I was using a 32bit win32 vim because that's what is readily available with python support that is compiled with MSVC so it could dynamically link with python. (mingw-w64 is not suitable because the python community compiles their DLLs with MSVC). As a result, I needed a 32 bit python. Not a big deal... but then trying to juggle the yeoman dependency for a 64 bit python led me to having to build vim from source so I could link to the 64bit python... Dependency hell... (I have solved the python dependency in vim... fortunately I don't use any plugins that leverage vim's ruby interface because the ruby community doesn't compile with MSVC.. they use mingw*. I hope I don't have to try to juggle ruby, python, and node all being compiled with 64bit MSVC.) It makes me want to work exclusively on unix-y machines where everything uses GCC.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.