How can I use Bower as a package manager with Visual Studio 2013? I.e. I have a .NET project and want to add some packages uses Bower.
I read Scott Hanselman's post, but it's not clear. I installed the plugins. Do I use the package manager console? Do I add bower as a package source?
My project already has a package.json.
If I open the VS command window and type bower, I receive the message: Command "bower" is not valid.
Bower is a front-end package manager built by Twitter. Also known as a Package manager for the Web, bower is used in modern open source and closed source projects to solve many recurrent issues.
To add a new Bower package to your project you use the install command. This should be passed the name of the package you wish to install. As well as using the package name, you can also install a package by specifying one of the following: A Git endpoint such as git://github.com/components/jquery.git.
Open your project or solution in Visual Studio, and select Tools > NuGet Package Manager > Package Manager Console to open the Package Manager Console window. In the console, enter Find-Package with a keyword to find the package you want to install.
Bower is a “package manager for the web.” Bower lets you install and restore client-side packages, including JavaScript and CSS libraries. For example, with Bower you can install CSS files, fonts, client frameworks, and JavaScript libraries from external sources.
If I am correct, the task explorer is only there to automate build tasks for you, combined with grunt. Getting NPM, Bower and Grunt are all manual steps you need to do for your project via the command line. After you installed the stuff from Hanselmans blog, you have to start with installing NPM for your project, then you add bower and grunt via NPM. DO the following:
npm init
and fill out the questions (name, description etc.)npm install bower -g
bower init
enter and fill out your project defaultsbower install angular --save
When that's done, you can include the generated files in visual studio (package.json and bower.json) and link the files in your index.html page
<script src="/bower_components/angular/angular.js"></script>
The visual studio tools are only ment to edit the bower.json and package.json within visual studio. You then only have to run bower install
to install new or changed packages
If you then want to automate some build tasks you can start with grunt to automate some stuff. Ref:start with Grunt
edit 1: I came across this post from John Papa. Gets you up and running in a breeze John Papa: Up and running with NodeJS ....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With