json No bower.json file to save to"
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.
You can run
bower init
to create the json file in the current directory.
Docs
If you're using Visual Studio (2017) you can simply do:
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.
The bower.json
file should always be in the root of your project folder. Furthermore, the file shouldn't be within the bower_components
folder, because bower is responsible for creating this folder itself.
The error means that if you run bower install --save
, the dependencies won't be recorded in your bower.json
. This is a bad idea, because you lose the big benefit a package manager provides.
Grunt and Bower work completely independent from one-another, you don't have to change anything regarding your Grunt setup to use grunt.
链接地址: http://www.djcxy.com/p/20088.html