LoginSignup
4
4

More than 5 years have passed since last update.

npmでnpm管理外のモジュールを指定するには

Last updated at Posted at 2014-05-22

背景

WindowsでAtom Shellをいじっていて、apmを使いたくなり、その時使える環境でapmを入れようとしたら、
さっそくコケた。

調べたところ、ネットワークのアクセスが厳しい環境だったので、sshでgit cloneしていることが原因だった。

package.jsonのdependenciesは色々と指定可能

npmの公式ページに解説があった

バージョン以外に、以下のようなURLも指定でることのと。

git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish

今回、自分の作業的には、ちょとこの説明とは違う形式な気もするが、
試行錯誤した結果、以下の記述で、sshではなく、httpsでcloneが可能となった。

"plist": "git+https://github.com/nathansobo/node-plist.git",

注意

http://のような通常のURLだと、そのURLをtarballとしてDLして展開して
扱うらしい。

関連するかもしれないリンク

関連記事

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