- 在本机安装 node : https://nodejs.org
- 在本机安装 Visual Studio Code : https://code.visualstudio.com/
- 在本机安装 git: https://git-scm.com/downloads
- 在本机安装 python: https://www.python.org/downloads/
打开 Terminal (Mac, Linux) 或者 Commnad Line (win)
- 运行
node -v应该看到输出v8.xxx - 运行
npm -v应该看到输出6.x.x - 运行
git --version应该看到输出git version 2.17.1
- Typescript:
npm i typescript -g - TS-Node:
npm i ts-node ts-node-dev -g - Node-Sass:
npm i node-sass-chokidar -g(这一步安装需要较长时间) - Yarn:
npm i yarn -g
- 运行
tsc -v应该看到输出Version 3.0.1 - 运行
yarn -v应该看到输出1.9.4 - 运行
ts-node -v应该看到 node, typescript 等版本号 - 运行
ts-node-dev应该看到Usage: ts-node-dev [options] script [arguments]
创建课程目录,运行 git clone https://github.com/naivefun/react-ts-tutorial.git
cd react-ts-tutorialyarnyarn start
等待编译结束应该会自动弹出主页,否则可以手动输入 http://localhost:3000 访问