LoginSignup
2

More than 5 years have passed since last update.

bower インストール

Last updated at Posted at 2018-03-31

nvmインストール

nodeを管理するnvmをインストールする

git clone git://github.com/creationix/nvm.git ~/.nvm

パスを通す

cd ~
vim .bash_profile

下記を追加
if [[ -s /home/{ユーザディレクトリ}/.nvm/nvm.sh ]] ; then source /home/{ユーザディレクトリ}/.nvm/nvm.sh ; fi

source .bash_profile
nvm --version

versionが表示されればOK

nodeインストール

nvm install v9.10.0
node- v

versionが表示されればOK

bower インストール

npm install -g bower
bower -v

versionが表示されればOK

bower 設定

bower.jsonを作成する

bower init

これで設定は完了

試しにjqueryをインストールする。

bower install jquery --save

bower_components 配下にインストールされる。
webrootにコピーが必要。

cp bower_components/jquery/dist/* webroot/js

また bower install すると bower.jsonに設定に従いインストールされるので
bower_components はgit管理から外しておく。

vim .gitignore

# bower
bower_components/*

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2