查看安装的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文件) (编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|