初學Vue遇到的問題及解決

一. Vue2.x升級3.x
首先執行命令 npm uninstall -g vue-cli卸載舊版本。
然后執行命令 npm install -g @vue-cli。
vue -V 查看當前版本。
Vue2.x創建項目的命令:vue init webpack xxx。
Vue3.x創建項目的命令:vue create xxx。
二.創建項目時報錯:
npm ERR! Unexpected end of JSON input while parsing near '...'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/apple/.npm/_logs/2019-05-22T03_14_59_254Z-debug.log
ERROR command failed: npm install --loglevel error --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist
解決辦法:
1、npm install chromedriver --
chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
2、npm cache clean --force
我遇到的問題就解決了

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容