Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing a bower package: "no-json No bower.json file to save to"

Tags:

I've added a bower package into my project root. I'm using bower so it's easier to manage the updates for each component (one of bower's features). However I got this message after install:

no-json No bower.json file to save to 

A few things:

— There is in fact a bower.json file w/i the component's folder. Should there be a global project bower.json file?

— Will this error mean the package will not update?

— The project is a WordPress project using the "WordPress-Starter-Theme" (which uses grunt to handle compass, etc). Is grunt interfering? Do I need to add anything into Gruntfile.js to manage Bower?

Thanks in advance.

like image 565
Callum Flack Avatar asked Jul 31 '13 11:07

Callum Flack


People also ask

Where is Bower json?

A few things: — There is in fact a bower. json file w/i the component's folder.

What is the use of Bower JSON file?

json file which defines some information about the projects as well as a list of dependencies. The bower. json file is actually used to define a Bower package, so in effect you're creating your own package that contains all of the dependencies for your application.

What is Bower json in .NET core?

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.


2 Answers

You can run

bower init 

to create the json file in the current directory.

Docs

like image 136
Tjorriemorrie Avatar answered Sep 20 '22 19:09

Tjorriemorrie


If you're using Visual Studio (2017) you can simply do:

  • Add New Item (On the project)
  • Choose: Web -> General -> Bower Configuration File

This will not only add a bower.json file, but also the .bowerrc file. Without the .bowerrc file the packages won't be copied from the hidden 'bower_components' folder to the wwwroot/lib folder.

like image 37
Run CMD Avatar answered Sep 19 '22 19:09

Run CMD