npmでのインストールエラー


以下の環境下でのエラー

```
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04 LTS
Release:	14.04
Codename:	trusty

$ nvm --version
nvm v0.6.1
```

bowerをnpmでインストールしたら、失敗してしまった

```
$ npm install bower -g
npm http GET https://registry.npmjs.org/bower

npm ERR! Error: No compatible version found: bower
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR!     at installTargetsError (/home/vagrant/.nvm/v0.6.11/lib/node_modules/npm/lib/cache.js:488:10)
npm ERR!     at next_ (/home/vagrant/.nvm/v0.6.11/lib/node_modules/npm/lib/cache.js:438:17)
npm ERR!     at next (/home/vagrant/.nvm/v0.6.11/lib/node_modules/npm/lib/cache.js:415:44)
npm ERR!     at /home/vagrant/.nvm/v0.6.11/lib/node_modules/npm/lib/cache.js:408:5
npm ERR!     at saved (/home/vagrant/.nvm/v0.6.11/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR!     at Object.oncomplete (/home/vagrant/.nvm/v0.6.11/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:231:7)
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>
npm ERR!
npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "node" "/home/vagrant/.nvm/v0.6.11/bin/npm" "install" "bower" "-g"
npm ERR! cwd /home/vagrant
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! message No compatible version found: bower
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/vagrant/npm-debug.log
npm not ok
```

[Node.jsのサイト](http://nodejs.jp/changelog.html)によると現在の安定版はv0.10.24らしいので、アップデートする

```
$ nvm install v0.10.24
$ nvm use v0.10.24
```

再挑戦したらできた！

```
$ npm install bower -g
・・・
bower@1.3.3 /home/vagrant/.nvm/v0.10.24/lib/node_modules/bower
├── is-root@0.1.0
├── junk@0.3.0
├── stringify-object@0.2.1
├── which@1.0.5
├── abbrev@1.0.5
├── chmodr@0.1.0
├── osenv@0.0.3
├── opn@0.1.1
├── archy@0.0.2
├── graceful-fs@2.0.3
├── lockfile@0.4.2
├── rimraf@2.2.6
├── bower-endpoint-parser@0.2.1
├── bower-logger@0.2.2
├── lru-cache@2.5.0
├── nopt@2.2.1
├── retry@0.6.0
├── mkdirp@0.3.5
├── tmp@0.0.23
├── q@1.0.1
├── semver@2.2.1
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── mout@0.9.1
├── request-progress@0.3.1 (throttleit@0.0.2)
├── p-throttler@0.0.1 (q@0.9.7)
├── shell-quote@1.4.1 (array-filter@0.0.1, array-reduce@0.0.0, array-map@0.0.0, jsonify@0.0.0)
├── bower-json@0.4.0 (deep-extend@0.2.8, intersect@0.0.3)
├── fstream@0.1.25 (inherits@2.0.1)
├── tar@0.1.19 (inherits@2.0.1, block-stream@0.0.7)
├── promptly@0.2.0 (read@1.0.5)
├── fstream-ignore@0.0.7 (inherits@2.0.1, minimatch@0.2.14)
├── glob@3.2.9 (inherits@2.0.1, minimatch@0.2.14)
├── bower-config@0.5.0 (mout@0.6.0, optimist@0.6.1)
├── decompress-zip@0.0.6 (mkpath@0.1.0, readable-stream@1.1.13-1, touch@0.0.2, binary@0.3.0)
├── request@2.34.0 (json-stringify-safe@5.0.0, forever-agent@0.5.2, aws-sign2@0.5.0, qs@0.6.6, tunnel-agent@0.3.0, oauth-sign@0.3.0, node-uuid@1.4.1, mime@1.2.11, tough-cookie@0.12.1, hawk@1.0.0, form-data@0.1.2, http-signature@0.10.0)
├── bower-registry-client@0.2.0 (request-replay@0.2.0, lru-cache@2.3.1, async@0.2.10, bower-config@0.4.5, request@2.27.0)
├── cardinal@0.4.4 (ansicolors@0.2.1, redeyed@0.4.4)
├── handlebars@1.3.0 (optimist@0.3.7, uglify-js@2.3.6)
├── inquirer@0.4.1 (readline2@0.1.0, mute-stream@0.0.4, through@2.3.4, async@0.2.10, lodash@2.4.1, cli-color@0.2.3)
├── update-notifier@0.1.8 (semver@2.1.0, request@2.27.0, configstore@0.2.3)
└── insight@0.3.1 (object-assign@0.1.2, async@0.2.10, lodash.debounce@2.4.1, request@2.27.0, configstore@0.2.3)
```

単にバージョンが古かっただけか…
Node.jsのバージョンには気をつけましょう(´・ω・｀)