前言
Yarn 對你的代碼來說是一個包管理器, 你可以通過它使用全世界開發者的代碼, 或者分享自己的代碼。Yarn 做這些快捷、安全、可靠,所以你不用擔心什麼。
通過Yarn你可以使用其他開發者針對不同問題的解決方案,使自己的開發過程更簡單。 使用過程中遇到問題,你可以將其上報或者貢獻解決方案。一旦問題被修復, Yarn會更新保持同步。
有好奇心的小朋友們如果想看看Yarn和Npm的區別,可以點擊傳送門。
下載Yarn
可以到Yarn官網,進行下載。
安裝Yarn之前需要先安裝NodeJs。
配置包管理器
如下截圖,選擇node.exe,然後選擇yarn的安裝目錄
(如果想把yarn改成npm,那麼修改Package Manager改成npm就可以,其他配置不用修改)
啓動項目
選擇Edit configurations…
選擇npm,然後進行如下的選擇。
運行結果
"xxxxxxxxxxxxxxx\node.exe" D:\soft\yarn\bin\yarn.js run start
yarn run v1.12.3
$ node scripts/start.js
Starting the development server...
Compiled successfully!
You can now view test in the browser.
Local: http://localhost:3006/
On Your Network: http://192.168.0.125:3006/
Note that the development build is not optimized.
To create a production build, use yarn build.