Vue CLIインストール時のエラー(EEXIST: file already exists, symlink ~)
エラー発生状況
nodeバージョン:v12.16.3
npmバージョン:6.14.4
Vue CLIをインストールするため
npm install -g @vue/cli
を実行したところ、
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
と怒られた。
どうやらアクセス権限を拒否されたみたいなので、
コマンドの先頭にsudoをつけて
sudo npm install -g @vue/cli
を実行したところ、
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/@vue/cli/bin/vue.js
npm ERR! dest /usr/local/bin/vue
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/@vue/cli/bin/vue.js' -> '/usr/local/bin/vue'
npm ERR! File exists: /usr/local/bin/vue
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:
と、さっきとは違うエラーが出た。
解決策
symlinkがどうちゃらこうちゃらなってるみたいなので色々ググって解決策を試してみたのですが一向に直らず。
でもnpmがおかしいんだろうなとは思っていたのでとりあえず
npm install -g npm
でnpmをアップデートし、
再度sudo無しで
npm install -g @vue/cli
を実行したところ、
なんとインストールできました。
Author And Source
この問題について(Vue CLIインストール時のエラー(EEXIST: file already exists, symlink ~)), 我々は、より多くの情報をここで見つけました https://qiita.com/00__/items/a0b51df05c6b6f5e4aa4著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .