关于create-react-app搭建react环境并修改端口号
来源:互联网 发布:小米平板2win10版优化 编辑:程序博客网 时间:2024/05/29 03:12
facebook给我们了一个类似vue-cli的脚手架的工具
首先:
- cnpm install -g create-react-app
cnpm是淘宝的镜像,由于国内vpn等原因网速比较慢,所以我们可以设置淘宝的镜像
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
这样我们就可以使用cnpm快速下载了。
接下来我们只需要输入
create-react-app my-app 就可以自动生成目录
进入我们的目录 cd my-app
然后 cnpm start 就成功的搭建了我们的react环境。
以前官方可以识别less等处理器,但是现在给删除了,同时有时我们需要更改默认的端口号,那么我们就要进入 node——modules文件夹然后
进入start.js文件找到这两行
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3001;
const HOST = process.env.HOST || '0.0.0.0';
开始的时候是3000端口我改成了3001
阅读全文
0 0
- 关于create-react-app搭建react环境并修改端口号
- Create-react-app 构建react环境
- react---学习笔记:使用create-react-app快速构建开发环境并创建项目
- React 修改端口号
- 使用express, create-react-app, mongodb搭建react模拟数据开发环境
- create-react-app结合node express框架搭建react项目开发环境
- react脚手架create-react-app
- React 如何修改端口号
- React 快速上手脚手架 create-react-app
- Create-React-App创建React项目
- Create-React-App创建antd-mobile开发环境
- Create-React-App创建antd-mobile开发环境
- 使用Create-React-App脚手架创建antd-mobile开发环境
- 使用 create-react-app 构建 react应用程序 (react-scripts)
- 使用 create-react-app 构建 react应用程序 (react-scripts)
- 使用 create-react-app 构建 react应用程序 (react-scripts)
- 关于ES6+React+webpack的环境搭建
- react native 项目端口号修改
- 数据降维工具箱drttoolbox
- 第一天正式开始学HTML标签~
- SNR
- CentOS6 mininal 安装CouchDB2 详细版
- 物理渲染学习笔记(二)——光的传播
- 关于create-react-app搭建react环境并修改端口号
- Java+Selenium3方法篇38-AutoIt工具处理文件上传
- Startting a blogger from now!
- Linux 下修改Tomcat使用的JVM内存大小
- 二、注解实现
- eclipse 配置tomcat
- PHP将富文本内容去除各类样式图片等只保留txt文本内容(作用于SEO的description)
- HTML&CSS——对背景图定位中background-position属性的自我理解
- 03 QT创建和加载动态库-①隐式加载