3
1

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 3 years have passed since last update.

npm install時にENOENT: no such file or directoryが出た場合の対処

Posted at

はじめに

ある日突然npm installができなくなった。(正しくは実行時にエラーになる。)

$ npm install -g @aws-amplify/cli
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/.npm/_cacache/tmp/823188c5
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/.npm/_cacache/tmp/823188c5'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

本記事はこのerrno -2でキャッシュフォルダが参照できない場合の対処について記載。

対処(結論)

$ unlink /home/vagrant/.npm

※指定するパスはご自身の環境で出力されているエラー文見て、合わせてください。

原因

対処コマンド見れば説明いらない気もするけど一応。
エラー時に出力されていたnpmのキャッシュ先パスがシンボリックリンクになっていた。
どのタイミングでシンボリックリンクが作られたのか記憶にない。。。

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?