天天看點

react檢視版本和更新以及create-react-app更新

[(7條消息) react檢視版本和更新以及create-react-app更新_u014678583的部落格-CSDN部落格_create-react-app版本](https://blog.csdn.net/u014678583/article/details/111722766)

檢視react版本及更新

目前的react版本在你的項目中的package.json檔案檢視

react檢視版本和更新以及create-react-app更新

檢視react最新版本

npm info react           

在第一行中有最新版本号

react檢視版本和更新以及create-react-app更新

安裝react最新版

  1. // @後面輸入版本号
  2. npm install --save [email protected]

create-react-app更新

第一步需要先檢視create-react-app最新版本

npm info create-react-app           
react檢視版本和更新以及create-react-app更新

接着檢視你目前的create-react-app版本,如果你的版本是小于最新版本的話,那就需要繼續往下看。

  1. create-react-app -V
  2. or 
  3. create-react-app --version
react檢視版本和更新以及create-react-app更新

第二步:如果你的版本是小于上面這個最新版本的話。那麼需要先解除安裝掉原先的舊版本: npm uninstall -g create-react-app

1、在解除安裝過程中如果遇到一個錯誤,這個錯誤傳回并提示create-react-app,create-react-app.cmd這兩個檔案的路徑時,那麼就要在電腦上找到對應的檔案并删除,我的提示的路徑是在這

react檢視版本和更新以及create-react-app更新

删除了之後再次運作檢視是否删除成功:create-react-app -V 或 create-react-app --version

react檢視版本和更新以及create-react-app更新

2、接着繼續安裝npm install -g create-react-app,如果在安裝過程中報如下錯誤時,那麼就要找到create-react-app的檔案夾位置并删除

react檢視版本和更新以及create-react-app更新
react檢視版本和更新以及create-react-app更新

這兩步操作之後,繼續全局安裝npm install -g create-react-app,并檢視版本号

react檢視版本和更新以及create-react-app更新
react檢視版本和更新以及create-react-app更新
  1. $ yarn create react-app antd-demo
  2. # or
  3. $ npx create-react-app antd-demo

繼續閱讀