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便利帳

0
Last updated at Posted at 2014-06-24

nom command

  • npmでインストールしたモジュール一覧

npm [-g] ls --depth=0

  • package.jsonへ依頼を追加する

直接にdependenciesキーに追加するか
npm install express --save // dependenciesに追加
npm install express --save-dev // devDependenciesに追加

  • path関連の調査

npm bin [-g] // node_modulesどこにインストールされている
require で探すモジュールのパスは global.module.paths の中に入っています.
デフォルトではカレントディレクトリから下りながら全てのディレクトリの node_modules が登録されています.
それに加えて NODE_PATH 環境変数の中にあるモジュールを探しに行きます.
モジュール読み込みの仕組み

npm gov web
https://www.npmjs.org/doc/

npm root -g
global node_modules path

npm info pkg_name
npm information

npm link pkg_name
link global module to local
http://www.infoq.com/cn/articles/msh-using-npm-manage-node.js-dependence

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?