zoukankan      html  css  js  c++  java
  • react安装 项目构建

    1.nodejs安装

    下载安装包,解压。如果是已编译文件,在/etc/profile中设置PATH(/etc/profile文件中的变量设置,所有用户可用,但需求重启服务器),并source /etc/profile。如果不是则进行编译安装。

    node -v 显示版本号则安装成功。

    2.react环境

    2.1react脚手架下载

    npm install -g create-react-app

    国内网络较慢可指定仓库

    npm install -g create-react-app --registry https://registry.npm.taobao.org

    2.2npm仓库设置

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

    3.react项目架建

    create-react-app web

    cd web

    npm run start

    4.react相关指令

    4.1 npm start或npm run start

    Starts the developent server.

    4.2 npm run build

    Bundles the app into static file for production.

    4.3 npm test

    Starts the test runner.

    4.4 npm run eject

    Removes this tool and copies build dependencies, config files and scripts into the app directory. If you do this, you can't go back!

  • 相关阅读:
    20200816
    20200815
    20200813
    20200811
    20200810
    20200806
    20200804
    20200803
    20200802
    20200801
  • 原文地址:https://www.cnblogs.com/Jiphen/p/8041400.html
Copyright © 2011-2022 走看看