環境
- 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