React Native开发之npm start加速
2016-09-01 16:55
387 查看
在Windows下好不容易安装好React Native环境之后,运行npm start,结果就是无限被等待,快的话160秒(将近3分钟啊。。。。)
而Mac下因为有watchman所以是飞一样的速度,1秒不到,一般几十到几百毫秒。此处一千一万只草泥飞在胸中奔腾…
所幸找到一个解决方案了,能让npm start也飞起来(500毫秒左右),操作步骤如下:
1、安装watchman,在Windows下暂时处于alpha版本但是可以使用,是一个zip包 https://facebook.github.io/watchman/docs/install.html | http://bit.ly/watchmanwinalpha
2、添加解压后的watchman到系统环境变量path中,如果成功的话, win + r输入 watchman -v应该返回的是3.7.0
3、右击项目svn目录,取消目录权限为只读,否则会报错,错误如下
[/code]
现在再来看看npm start的速度,Windows也能飞起来了^_^
参考stackoverflow上的帖子,它给出的是Mac下的方案,使用chmod 777来修改权限为读、写、删,对应Windows下我怀疑是只读,所以试了一下取消只读,居然可以了
React-Native Failed to build DependencyGraph: Watchman error
鉴于bit.ly被墙,这里我将watchman.zip上传到了博客园,可以点击这里直接下载>>
而Mac下因为有watchman所以是飞一样的速度,1秒不到,一般几十到几百毫秒。此处一千一万只草泥飞在胸中奔腾…
所幸找到一个解决方案了,能让npm start也飞起来(500毫秒左右),操作步骤如下:
1、安装watchman,在Windows下暂时处于alpha版本但是可以使用,是一个zip包 https://facebook.github.io/watchman/docs/install.html | http://bit.ly/watchmanwinalpha
2、添加解压后的watchman到系统环境变量path中,如果成功的话, win + r输入 watchman -v应该返回的是3.7.0
3、右击项目svn目录,取消目录权限为只读,否则会报错,错误如下
[code][Hot ;Module Replacement] Server listening on /hot React ;packager ready. Failed ;to build DependencyGraph: Watchman error: query failed: synchronization failed: Permission denied. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html. Error: ;Watchman error: query failed: synchronization failed: Permission denied. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html. ; at /Users/Ali/Desktop/app/Test/node_modules/react-native/node_modules/node-haste/lib/crawlers/watchman.js:63:11 at process._tickCallback (node.js:368:9)
[/code]
现在再来看看npm start的速度,Windows也能飞起来了^_^
参考stackoverflow上的帖子,它给出的是Mac下的方案,使用chmod 777来修改权限为读、写、删,对应Windows下我怀疑是只读,所以试了一下取消只读,居然可以了
React-Native Failed to build DependencyGraph: Watchman error
鉴于bit.ly被墙,这里我将watchman.zip上传到了博客园,可以点击这里直接下载>>
相关文章推荐
- react-native开发:创建项目报错:Command `npm install --save --save-exact react-native` failed.
- App开发日报 2015-04-28 React Native 调研报告
- Facebook React Native开发入门
- React Native 开发环境部署
- Windows环境搭建React Native Android的开发环境
- React Native Android 开发中遇到的坑
- 快速搭建 Node.js 开发环境以及加速 npm
- Ubuntu进行 React-Native 的开发
- react-native 开发环境搭建
- iOS开发——React Native入门总结
- React Native for Android on Windows 配置开发安装总结
- 快速搭建 Node.js 开发环境以及加速 npm
- Start React Native In Android
- Facebook 开源安卓版 React Native,开发者可将相同代码用于网页和 iOS 应用开发
- npm install -g react-native-cli 提示npm ERR!
- 快速搭建 Node.js 开发环境以及加速 npm
- react-native试玩(34)-配置Android开发环境
- windows部署React-Native的开发环境实践(技术细节)
- react-native for android windows开发环境搭建详细记录