根據上邊博客文章,完成下載及安裝。
問題一:
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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 (though this is not recommended).
解決:使用管理員身份運行cmd或者windows powershell
問題二:npm config set prefix “XXXX” 設置后想更換
解決:刪除X:\Users\用戶名\.npmrc整個文件 或者 文件下對應的配置:
prefix =C:\Program Files\nodejs\node_global cache =C:\Program Files\nodejs\node_cache
問題三:npm WARN Local package.json exists, but node_modules missing, did you mean to install?
解決方法:
輸入npm install 或 cnpm install 后,再次啟動
npm run dev 成功啟動!
上邊方式不行的話,嘗試: