微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

react 杂

查看安装的react-native和react版本

npm infoReact-native(目前是0.34.1)

知道最新版本后,通过以下命令来安装:

npm install --save react-native@0.34.1

同样,

npm info react(目前是15.3.2)

知道最新版本后,通过以下命令来安装:

npm install --save react@15.3.2

vim package.json

///

npminstall

淘宝 NPM 镜像

这是一个完整npmjs.org镜像,你可以用此代替官方版本(只读),同步频率目前为10分钟一次以保证尽量与官方服务同步。

http://npm.taobao.org/

npminstall-gcnpm--registry=https://registry.npm.taobao.org

cnpminstall

cnpmrunbuild

cnpmrundev-server

cnpmrundev-server

cnpmrun start

cpm install --global babel-cli

智能的npm,让你在中国使用npm时,下载速度更快,使用更方便!

https://github.com/qiu8310/smart-npm/

npm install --global smart-npm --registry=https://registry.npm.taobao.org/

snpminstall

snpmrunbuild

-------------------------------------------------------------

卸载npm

centos sudonpmuninstallnpm-g

windows npmuninstallnpm-g

npminstallreact@15.3.0
npminstallreact-dom@15.3.0
npmrunsetup

snpminstallreact@15.3.0

snpminstallreact-dom@15.3.0

snpmrunsetup

snpmrun start


cnpmrunbuild

npm run dev (正常编译模式)

 npm run hot (热替换编译模式)

 访问 http://localhost:8088

 npm run dist (发布生产版本,对代码进行混淆压缩,提取公共代码,分离css文件

原文地址:https://www.jb51.cc/react/304524.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐