5
5

More than 5 years have passed since last update.

[Linux] whichがいつのまにかnode_modulesになっていた。。

Last updated at Posted at 2015-06-08

経緯

nodejsのバージョンをあげようと思って、yumからnodejsとnpmを削除後
ソースコンパインルでnodejsをインストール。

そのとき、インストールディレクトリを/usr から /usr/local に変更した。

そしたらなぜかwhichがなくなっていたので、lsしたらnode_modulesになっていた

$ ls -la /usr/bin/which
lrwxrwxrwx 1 root root 35 Jun  5 17:21 which@ -> ../lib/node_modules/which/bin/which

修復

whichの再インストール

$ sudo yum reinstall which

(中略)

$ ls -la /usr/bin/which
-rwxr-xr-x 1 root root 20768 Jun 22  2011 /usr/bin/which*

いつのまに書き換えられていたんだろう…

追記

sudo npm install -g hogehogeが正常に動かないなど
いろいろ弊害がでてきたので、prefix=/usr に変更しました。。

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