#vue cliが使いたい(mac)
前提としてnodeがインストールされていること
npm install -g vue-cli
vue --version
記載時点では2.9.6がインストールされた。
vue createしたら
`$ vue create vue-app
vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6.
You may want to run the following to upgrade to Vue CLI 3:
npm uninstall -g vue-cli
npm install -g @vue/cli
`
verが足りなかったのでやり直し
npm uninstall -g vue-cli
removed 240 packages in 6.14s
npm install -g @vue/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
/Users/hoge/.nodebrew/node/v13.9.0/bin/vue -> /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/bin/vue.js
> fsevents@1.2.11 install /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/fsevents
> node-gyp rebuild
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:321:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Users/hoge/.nodebrew/node/v13.9.0/bin/node" "/Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/fsevents
gyp ERR! node -v v13.9.0
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok
> core-js@2.6.11 postinstall /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/babel-polyfill/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> core-js@2.6.11 postinstall /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.6.4 postinstall /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> @apollo/protobufjs@1.0.3 postinstall /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/@apollo/protobufjs
> node scripts/postinstall
> nodemon@1.19.4 postinstall /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
> ejs@2.7.4 postinstall /Users/hoge/.nodebrew/node/v13.9.0/lib/node_modules/@vue/cli/node_modules/ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/@vue/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ @vue/cli@4.2.2
added 1105 packages from 648 contributors in 238.581s
gyp: No Xcode or CLT version detected!
が出ていたのでnode-gypをいれて
npm install node-gyp
xcode command line toolを使うように設定
sudo xcode-select --switch /Applications/Xcode.app
一度アンインストール
npm uninstall -g @vue/cli
もうちいどやってみる
npm install -g @vue/cli
今度はエラーなく成功。
XCodeのCommand line toolも必要のようですが、それは入れてあったのでnode-gypをいれただけで大丈夫だった