Win 10 64 ビット Dev マシンで Web アプリ ジェネレーターをテストしようとしてきたので、PS シェル コマンド ウィンドウを開き、次の手順に従いました。
// 1. Install core of yeoman
npm install -g yo
// Wait until yeoman installation is completed
// 2. Install bower
npm install -g bower
// Wait until bower installation is completed
// 3. Install Grunt Client
npm install -g grunt-cli
// Wait until grunt client installation is completed
// 4. Install the first generator
npm install -g generator-webapp
*npm WARN deprecated graceful-fs@2.0.3: graceful-fs version 3 and before
will fail on newer node releases. Please update to graceful-fs@^4.0.0 as
soon as possible*.
// if I temporarily "ignore" the error and carry on.....
// note I notice my npm version was old so altered the system path and now
// 3.8.7
mkdir test
cd test
yo WebApp
grunt serve
A valid Gruntfile could not be found. Please see the getting started
guide for more information on how to configure grunt:
http://gruntjs.com/getting-started
それはいい!
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'App/**/*.js', 'test/**/*.js'],
options: {
globals: {
jQuery: true
}
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jshint']);
};
今、私はこのエラーに遭遇しました(私はServeタスクが定義されていないことを知っています)
grunt serve 警告: タスク "serve" が見つかりません。--force を使用して続行します。
この時点で、コミュニティに質問する必要があると思いました ;-)。インストールされている Bower などのバージョンを確認する必要があるかもしれません
ダニエル