我試圖建立一個自耕農發生器和使用教程作爲指導 http://yeoman.io/generators.html#writing-your-first-generator多咕嚕任務未發現
我從引用的gist複製Gruntfile.js並把它放在我的發電機的模板目錄。當我生成項目,我跑
npm install && bower install
然後
grunt test
本地NPM模塊 「咕嚕模板 - 茉莉requirejs」 找不到。它是否安裝? 警告:未找到任務「併發:測試」。使用--force繼續。未找到測試:
Aborted due to warnings.
Execution Time (2014-01-10 16:19:20 UTC)
loading tasks 3ms
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 50%
test 2ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
Total 6ms
爲什麼格朗特同時這是我不清楚。 Grunt找到了乾淨的測試任務。我嘗試評論併發任務,除了「clean」之外,沒有其他任務被發現用於「測試」。這裏是任務列表
grunt.registerTask( '測試',[ '乾淨:服務器', '併發:測試', 'autoprefixer', '連接:測試', '因果報應' ]);
好點jakerella我現在看到我在我的yeoman生成器中使用不同的grunt文件,然後我打算。當我用yeoman教程中引用的要點替換Gruntfile.js時,我遇到了與另一個任務相同的問題。它說「看」沒有被發現。
$ ls node_modules/
bower grunt-contrib-compass grunt-contrib-jshint grunt-template-jasmine-requirejs
connect-livereload grunt-contrib-concat grunt-contrib-jst grunt-usemin
grunt grunt-contrib-connect grunt-contrib-livereload load-grunt-tasks
grunt-bower-requirejs grunt-contrib-copy grunt-contrib-requirejs matchdep
grunt-connect-proxy grunt-contrib-cssmin grunt-contrib-uglify moment
grunt-contrib-clean grunt-contrib-htmlmin grunt-open time-grunt
grunt-contrib-coffee grunt-contrib-imagemin grunt-regarde
$ grunt server
>> Local Npm module "grunt-template-jasmine-requirejs" not found. Is it installed?
Warning: Task "watch" not found. Use --force to continue.
Aborted due to warnings.
$
我在''test'多任務中引用的要點中看到的唯一任務是'connect' ...您需要向我們提供您的實際Gruntfile以便我們提供幫助。 – jakerella