A-A+

reactJS快速上手,看完代码,一切了然于心

2017年11月09日 Web开发 暂无评论 阅读 41 views 次

快速搭建

macOS 或者 Linux 当中用 create-react-app 可以快速启动一个 React 页面:

npm 如果失败,用下面的镜像。

 npm install -g cnpm --registry=https://registry.npm.taobao.org

npm install -g create-react-app

create-react-app my-app cd my-app/

npm start


选择一个编辑器

在线的就用https://codepen.io/gaearon/pen/gWWZgR?editors=0010

本地的,可以使用先进的React GUI编辑器 — Structor

npm install structor -g
structor

如果用了镜像,要执行 cnpm install structor



E:\react\my-app\node_modules\structor>cnpm install
- [49/52] Installing jsbn@~0.1.0platform unsupported gulp-watch@4.3.9 › chokidar
@1.7.0 › fsevents@^1.0.0 Package require os(darwin) not compatible with your pla
tform(win32)
[fsevents@^1.0.0] optional install error: Package require os(darwin) not compati
ble with your platform(win32)
√ Installed 52 packages
√ Linked 424 latest versions
? Specify a directory name where the source code of the generated components wi
ll be.
 If the directory does not exist in the current project structure it will be cr
eated.
 demo1
Meta data folder is created successfully. Version: 2.3.2
√ Run 1 scripts
deprecate gulp@3.9.1 › vinyl-fs@0.3.14 › glob-stream@3.1.18 › minimatch@^2.0.1 P
lease update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
deprecate gulp@3.9.1 › vinyl-fs@0.3.14 › glob-watcher@0.0.6 › gaze@0.5.2 › globu
le@0.1.0 › minimatch@~0.2.11 Please update to minimatch 3.0.2 or higher to avoid
 a RegExp DoS issue
deprecate gulp@3.9.1 › vinyl-fs@0.3.14 › glob-watcher@0.0.6 › gaze@0.5.2 › globu
le@0.1.0 › glob@3.1.21 › graceful-fs@~1.2.0 graceful-fs v3.0.0 and before will f
ail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as pos
sible. Use 'npm ls graceful-fs' to find it in the tree.
Recently updated (since 2017-09-03): 12 packages (detail see file E:\react\my-ap
p\node_modules\structor\node_modules\.recently_updates.txt)
  Today:
    → gulp-autoprefixer@3.1.1 › postcss@5.2.17 › js-base64@^2.1.9(2.2.0) (17:14
:06)
    → gulp-babel@6.1.2 › babel-core@6.26.0 › babel-register@6.26.0 › source-map
-support@^0.4.15(0.4.18) (17:44:08)
    → react-bootstrap@0.30.6 › react@15.6.1 › fbjs@0.8.15 › isomorphic-fetch@2.
2.1 › node-fetch@1.7.3 › encoding@0.1.12 › iconv-lite@~0.4.13(0.4.19) (11:56:41)

√ All packages installed (492 packages installed from npm registry, used 2m, sp
eed 48.63kB/s, json 447(855.17kB), tarball 3.49MB)



E:\react\my-app>cnpm run structor

> my-app@0.1.0 structor E:\react\my-app
> structor

Structor has been started successfully.

Open in the browser: http://localhost:2222/structor

工具已跑起来了。


捕获

打赏作者
如果文章对您有所帮助请打赏支持本站发展。

您的支持将鼓励我们继续创作!

[微信] 扫描二维码打赏

[支付宝] 扫描二维码打赏

标签:

给我留言

您必须 登录 才能发表留言!

Copyright © 前端技术分享休闲玩耍去处分享-大一网 保留所有权利.   Theme  Ality

用户登录 ⁄ 注册

分享到: