Use bower.json location as a parameter to bower install - bower

Is it possible to use the bower.json location as a parameter to the bower install command?
Something like:
bower install -d /var/www/html/bower.json
I would like to run bower install in a single line command and I do not have the option to "cwd" first.

cd /var/www/html/your_directory && bower install

Related

Bower packages don't install

I am trying to install bower packages, in the site of bower is written I must install them following way:
bower install <package>
But it doesn't want to install this kinda way. Instead,it tells me something like:
ENOGIT git is not installed or not in the PATH
How to deal with this kinda problem?
Thank you.
you have to install git, some package in bower depend on git to be installed

bower install just says cached validate, but doesn't install

I am trying to install progressbar.js into my rails app.
I run bower install progressbar.js
And the terminal puts out:
bower progressbar.js#* cached https://github.com/kimmobrunfeldt/progressbar.js.git#1.0.1
bower progressbar.js#* validate 1.0.1 against https://github.com/kimmobrunfeldt/progressbar.js.git#*
The files are not put into the app. When I run bower list, it has:
progressbar.js#1.0.1 extraneous
How do I install this? Other times I run bower install, it has worked no problem.

Can I get bower to install packages when there's a version mismatch?

When I upgrade a version in bower.json from say 2.8.1 to 2.8.2 and run bower install it doesn't actually install the new version. I can run bower install -f but that re-installs all packges.
Can I make bower install only when necesary?
https://bower.io/docs/api/#update
So this could help:
bower update --save <package-name>

bower automatically update bower.json

I run the following commands using bower 1.0.0:
mkdir testdir;cd testdir
bower init #accept defaults
bower install jquery -s #the -s is supposed to cause update of bower.json
less bower.json
In bower.json I expect to see dependencies listed, but there are none. What is going on?
NOTE: bower install jquery --save does work
NOTE:
The option I am referring to was documented through bower help install
**-S**, --save Save installed packages into the project's bower.json dependencies
from bower help, save option has a capital S
-S, --save Save installed packages into the project's bower.json dependencies

Bower, Grunt & zsh: command not found:

I have installed Grunt & Bower & I'm using ZSH.
when I type bower --help or grunt anything I get zsh: command not found: bower or zsh: command not found: grunt how can I fix this?
Add /usr/local/share/npm/bin/ to your $PATH environment
I couldn't get the above to work. Problem was that I had just reinstalled my Mac and forgotten to re-install grunt.
You can test that grunt is actually installed and working properly outside of zshell by going back to bash with bash -l and running grunt.
If grunt is throwing the same error you can install grunt by running:
sudo npm install -g grunt-cli
Run zsh to get back to zshell.
When you installed, did you install globally?
npm install -g bower
give that a try. If not, also try adding sudo
sudo npm install -g bower
When you install grunt (bower), terminal tell you directory. For those using a ZSH shell, add this to .zshrc:
export PATH=/usr/you/directory/npm/bin:$PATH,
I find it using:
/lib/node_modules
export PATH=/usr/lib/node_modules/npm/bin:$PATH
I used yarn instead of npm:
yarn add grunt grunt-cli
yarn grunt
It worked for me.
Hopefully, it will help someone else :)
If you are using the GNOME-Terminal (default in Ubuntu Unity and Gnome) try the answer of https://askubuntu.com/questions/279180/nvm-command-not-found-issue.

Resources