博客 / 詳情

返回

info There appears to be trouble with your network connection

使用 npx create-react-app 項目名 新建項目時,報錯;

yarn add v1.22.4
info No lockfile found.
[1/4] 🔍  Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

解決途徑:

第一步:更換淘寶鏡像

yarn config set registry https://registry.npm.taobao.org

第二步:按下面的操作

  1. 全局安裝nrm: npm install nrm -g;
  2. 查看鏡像源: nrm ls;
  3. 切換鏡像源: nrm use npm;
  4. 安裝需要的模塊: npm install <package-name>;
  5. 如果需要安裝全部依賴: npm install;
user avatar
0 位用戶收藏了這個故事!

發佈 評論

Some HTML is okay.