運行antd pro v4


1、安裝yarn

curl -o- -L https://yarnpkg.com/install.sh | bash

 

出現了提示信息:

> WARNING: GPG is not installed, integrity can not be verified!

> Extracting to ~/.yarn...

> Adding to $PATH...

> Profile not found. Tried  (as defined in $PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.

> Create one of them and run this script again

> Create it (touch ) and run this script again

   OR

> Append the following lines to the correct file yourself:

 

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

 

將最后一行,放到命令行即可。

2、yarn create umi my-app

  cd my-app

3、yarn

warning Error running install script for optional dependency: "/Users/songya/antdpro/my-app/node_modules/puppeteer: Command failed.

Exit code: 1

Command: node install.js

Arguments: 

Directory: /Users/songya/antdpro/my-app/node_modules/puppeteer

Output:

ERROR: Failed to download Chromium r669486! Set \"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD\" env variable to skip download.

{ Error: read ETIMEDOUT

    at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27)

  -- ASYNC --

    at BrowserFetcher.<anonymous> (/Users/songya/antdpro/my-app/node_modules/puppeteer/lib/helper.js:111:15)

    at Object.<anonymous> (/Users/songya/antdpro/my-app/node_modules/puppeteer/install.js:64:16)

    at Module._compile (internal/modules/cjs/loader.js:707:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)

    at Module.load (internal/modules/cjs/loader.js:605:32)

    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)

    at Function.Module._load (internal/modules/cjs/loader.js:536:3)

報錯:ERROR: Failed to download Chromium r669486! Set \"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD\" env variable to skip download.

解決方法:npm install -g cnpm --registry=https://registry.npm.taobao.org

     cnpm i puppeteer

4、yarn start

  error     Error: Cannot find module 'react' 

 

解決方法:yarn add react

 

 

 

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

 

 

解決方法:rm package-lock.json

5、yarn start

App running at:

  - Local:   http://localhost:8000/ (copied to clipboard)

  - Network: http://10.28.175.13:8000/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM