LoginSignup
2
0

More than 3 years have passed since last update.

Angular CLI を npm install しようとしたら、EEXIST: file already exists .... といったエラーが出た場合の対応

Posted at

環境

  • macOS 10.15.5
  • node: 13.11.0
  • npm: 6.13.7

angular cli をインストールしようとした際に遭遇したエラー

% npm install -g @angular/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/@angular/cli/bin/ng
npm ERR! dest /usr/local/bin/ng
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/@angular/cli/bin/ng' -> '/usr/local/bin/ng'
npm ERR! File exists: /usr/local/bin/ng
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/watashi/.npm/_logs/2020-07-09T08_20_01_508Z-debug.log

解決した方法

  • エラーに表示されていた通り、 File exists: /usr/local/bin/ng. なので Remove the existing file and try again, or run npm with --force to overwrite files recklessly. します
% sudo rm -rf /usr/local/bin/ng

その後、通常通りインストールします

% npm install -g @angular/cli
2
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
2
0