5
5

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の-gインストールしたのにパスが通ってない遍

Posted at
npm install -g karma

おこられる。

ぐぐると、いろいろでてくるが

npm install -g ws

なぜかこれでエラーが減って、sudo npmにするとエラーがなくなる。(ws: web socket)
よしよし・・・

$ karma
 command not found

えー><

npm bin -g # /usr/local/bin
npm bin -g karma # /usr/local/bin
ls /usr/local/bin/karma # ねーよ
ls /usr/local/lib/node_modules/ # karmaあるやん

なるほほ
karmaに限らず、実行本体は

node_modules > MODULENAME > bin > MODULENAME

みたいな構成なので
npm bin -g のパスをlib > に通します。

$ karma --version
-bash: karma: command not found
$ ln -s /usr/local/lib/node_modules/karma/bin/karma /usr/local/bin/karma
$ karma --version
version: 0.12.16

.bash_profileにPATH追加とかするのが、賢い方法らしいけど。libってローカルインストールだし追加していいのかわかりませんでした。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?