PR

Git を使えるようにする

npm というのはnode.js のパッケージ管理システムなのだそう。(node.js のインストールは「node.js をインストールせずに使う」に記載)

npm をインストールする前に、Git と Python をインストールする必要がある。(「Node.js のパッケージ管理システム npm を Windows で利用する – waりとnaはてな日記」より引用)

ということなので(Python は「Portable Python」で準備するとして)、ここではgit を使えるようにする。

Git(ギット)はプログラムなどのソースコード管理を行う分散型バージョン管理システム。動作速度に重点が置かれている。Linuxカーネルのソースコード管理を目的として、リーナス・トーバルズによって開発された(「Git – Wikipedia」より引用)

スポンサーリンク

ダウンロード

Downloads – msysgit – Git for Windows – Google Project Hosting」から「PortableGit-1.7.10-preview20120409.7z」をダウンロードした。

スポンサードリンク

※Windows7 SP1 64bit で試用した

ファイルの展開

拡張子が7z なので「7-Zip Portable」などで解凍する。

インストール

フォルダの作成

適当にc:\git を作成して-

ファイルの配置

解凍したものをそっくり移動した。

設定

パスを通す

システムの環境変数Path にc:\git\bin を追加した。

動作確認

バージョンが表示されたので、OK なんじゃないかな。

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\Users\Owner>git --version
git version 1.7.10.msysgit.1

mpn をインストール

mpn のインストールを試行したが、エラーとなって上手く行かなかった。

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Owner>cd %NODE_HOME%

c:\node\v0.6.15>git config --system http.sslcainfo /bin/curl-ca-bundle.crt

c:\node\v0.6.15>git clone --recursive git://github.com/isaacs/npm.git
Cloning into 'npm'...
remote: Counting objects: 19303, done.
remote: Compressing objects: 100% (5447/5447), done.
remote: Total 19303 (delta 14150), reused 18790 (delta 13697)
Receiving objects: 100% (19303/19303), 5.78 MiB | 1.23 MiB/s, done.
Resolving deltas: 100% (14150/14150), done.

c:\node\v0.6.15>cd npm
c:\node\v0.6.15\npm>node cli.js install npm -gf
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-1.1.18.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.1.18.tgz
npm ERR! cb() never called!
npm ERR!
npm not ok

また、「PortableGit-pre-alpha-64-bit.7z」でも試したが上手く行かなかった。

node.exe しか配置していない環境に、自動的に幾つかのフォルダが作成され、動作しそうなものなのだが(npm は空フォルダだった)。

→ 「npm を使えるようにする」で解決(?)した

参考文献

スポンサードリンク

コメント