Just do IT

思うは招く

Vue CLI でローカルサーバーが起動しないときの対処

発生した問題

vue createでアプリが作成されない。

参考:Creating a Project | Vue CLI

🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kotakanazawa/.npm/_logs/2020-05-08T03_49_24_394Z-debug.log
 ERROR  command failed: npm install --loglevel error

解決

以下の記事を参考にさせていただいた。

【Vue.js】vue createがコケまくる時の対処法 - Qiita

$ vim ~/.vuerc

をして、

"useTaobaoRegistry": true, # これをfalseに変える

これでvue createするとアプリができた。

# 該当アプリのディレクトリへ移動し、サーバー起動
npm run serve

ようやく表示できた。

f:id:K_Koh:20200508133904j:plain
サーバーを起動できた