Can / should use Grunt with Bower without Npm?

I am a bit confused about using Npm, Bower and Grunt. My goal is to install front-end packages (for example: bootstrap) for my front-end project and configure Grunt to automate build tasks.

I have used Npm in the past, and I understand that it works with the package.json file, and Bower works with the bower.json file. In this case, I installed Grunt with Bower (not Npm), however I realized that to start Grunt I still need to add the package.json file.

  • Should I use Bower to install Grunt in the first place?
  • Does my project always need a package.json file to use Grunt? And also if so, is there any good practice to eliminate duplication between bower.json and package.json files. (name, application version, etc.)

thank

+4
source share
1 answer
  • grunt (grunt-cli) is a runner for the command line, not frontend library :), so installing it through the chat is strange, but possibly because bower uses npm as the base repository :)
  • package.json stores all the tool dependencies in your project - for example, a gazebo or grunt.

In the frontend development bower, you should handle the css / js libraries in your application, for example jQuery, Angular.js, Bootstrap. NPM is for node.js extensions / utilities such as grunt, karma devDependencies.

http://blog.nodejitsu.com/package-dependencies-done-right/

+4
source

All Articles