编程知识 cdmana.com

Pancakeswap front-end source compilation - Windows

One 、nodejs install

1.1 Installation environment

The computer :win 10 64 position

nodejs:node-v12.20.0-x64

nodejs Download the official website : nodejs Official website . Or select the version to download :https://nodejs.org/download/release/v12.20.0/node-v12.20.0-x64.msi

Click the selected icon to download to the local computer .

1.2 Start installation

1、 Put the installation package in the designated location of your computer , Double click execute

2、 Click next

3、 Click next after checking

4、 Click on the change Button , Change to your designated installation position , Click next , Of course, it's OK not to change the default location .

5、 Click next by default

explain :

1、Node.js runtime Represents the operating environment

2、npm package manager Express npm Package manager

3、online documentation shortcuts Online document shortcuts

4、Add to PATH Add to environment variables

6、 We can leave this step unchecked , Go straight to the next step .

7、 Click our Install button

8、 After a while, the installation success button will appear , Let's click finish , It means that the installation is successful !

1.3 Verify the installation

Node.js Installation completed , You can start with a simple test to see if the installation is successful .

1、 Press on the keyboard 【win+R】 key , Input cmd, And then go back , Open the command line interface

2、 Enter the command prompt window , Input the following commands respectively , Display version number , Installation succeeded , Pictured .

node -v      Show installed nodejs edition npm -v       Show installed npm edition 

notes : This is explained below : New version of the Node.js I have brought with me npm, install Node.js Will be installed together ,npm The function of is to Node.js Dependent packages for management , It can also be understood as being used to install / uninstall Node.js What needs to be packed .

1.4 Use nodejs install yarn

1、 stay cmd Use the command in the window to install the dependency management tool yarn

npm install -g yarn

2、 see yarn Version number

yarn --version

Two 、pancakeswap Front end source code compilation

2.1 yarn Installation dependency

1、 Enter the source directory

2、git initialization

3、 perform yarn Installation dependency

2.2 Build the project

1、 modify packge.json file build Parameters

 take packge.json In your file  "build": "CI=false react-scripts build", It is amended as follows  "build": "react-scripts build",

2、 Execute the command to build the project

npm run build

3、 Check whether the project is built successfully

3、 ... and 、 Problem solving

3.1 git Can't be found

  • Wrong content :
fatal: not a git repository (or any of the parent directories): .git

  • Error reason :git Can't be found
  • resolvent : Initialize in the source folder path git
git init

3.2 Project construction error

  • Wrong content :
npm ERR! [email protected] build: `CI=false react-scripts build`

  • resolvent :
 take packge.json In your file  "build": "CI=false react-scripts build", It is amended as follows  "build": "react-scripts build",

版权声明
本文为[toString]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/10/20211002145721851w.html

Scroll to Top