0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

npmでfluctがインストールできなかった

Posted at

MacOS X Yosemite に nodebrewを使ってnode/npmをインストール。
そのあと、fluctをインストールしようとしたら失敗して困った件

nodebrewのインストール

Homebrewが入っているとして、nodebrewのインストール。

brew install nodebrew

nodebrewのバージョンをチェック

$ nodebrew -v
$ nodebrew 0.8.1

nodeのインストール

nodebrew install-binary stable

node/npmのバージョンチェック

$ node -v
$ v4.0.0

$ npm -v
$ 2.12.1

npmでfluctインストール(失敗)

$ npm install fluct -g

と叩いてもエラーがでる。
エラーの内容を残してなかったけど、checksumが不正と。
↓な感じ(違うモジュールのエラーだけど内容的にはこれ)

npm ERR! registry error parsing json
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/Zee/.nvm/versions/io.js/v2.5.0/bin/iojs" "/Users/Zee/.nvm/versions/io.js/v2.5.0/bin/npm" "install"
npm ERR! node v2.5.0
npm ERR! npm  v2.13.2

npm ERR! shasum check failed for /var/folders/yg/bz8zpb3n7p778blpqjrd54hc0000gn/T/npm-99355-5be3067f/registry.npmjs.org/modernizr/-/modernizr-3.0.0.tgz
npm ERR! Expected: c8f2db9ebcf97e68244b767269e54140dfaec5db
npm ERR! Actual:   da39a3ee5e6b4b0d3255bfef95601890afd80709
npm ERR! From:     https://registry.npmjs.org/modernizr/-/modernizr-3.0.0.tgz
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

で、いろいろ調べたけ結果workaround発見

DNSを設定すると。

DNSの設定

ということで、YosemiteのDNSの設定。

$ sudo cp /private/etc/hosts /private/etc/hosts.bak
$ sudo vi /private/etc/hosts

で、hostsファイルを編集。

23.235.39.162   registry.npmjs.com
23.235.39.162   registry.npmjs.org

の2行を追加して、viを閉じる。
で、DNSのcacheをクリアします

$ dscacheutil -flushcache

これで、準備が完了です

fluctのインストール(成功!)

% npm install fluct -g
/usr/local/bin/fluct -> /usr/local/lib/node_modules/fluct/bin/fluct
fluct@0.3.3 /usr/local/lib/node_modules/fluct
├── open@0.0.5
├── config@1.16.0
├── ejs@2.3.4
├── yazl@2.2.2 (buffer-crc32@0.2.5)
├── commander@2.8.1 (graceful-readlink@1.0.1)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── glob@5.0.14 (path-is-absolute@1.0.0, inherits@2.0.1, once@1.3.2, inflight@1.0.4, minimatch@2.0.10)
├── node-aws-lambda@0.1.6 (async@1.4.2, https-proxy-agent@1.0.0)
├── moment@2.10.6
├── express@4.13.3 (escape-html@1.0.2, merge-descriptors@1.0.0, array-flatten@1.1.1, cookie@0.1.3, utils-merge@1.0.0, cookie-signature@1.0.6, methods@1.1.1, fresh@0.3.0, range-parser@1.0.2, vary@1.0.1, path-to-regexp@0.1.7, etag@1.7.0, content-type@1.0.1, parseurl@1.3.0, content-disposition@0.5.0, serve-static@1.10.0, depd@1.0.1, qs@4.0.0, finalhandler@0.4.0, on-finished@2.3.0, debug@2.2.0, proxy-addr@1.0.8, send@0.13.0, accepts@1.2.13, type-is@1.6.8)
├── amazon-api-gateway-client@0.1.3 (stackable-fetcher-aws-signer-v4@0.0.1, stackable-fetcher@0.3.0)
└── aws-sdk@2.2.1 (xmlbuilder@0.4.2, xml2js@0.2.8, sax@0.5.3)
0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?