zoukankan      html  css  js  c++  java
  • React Native开发之npm start加速

    在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目录,取消目录权限为只读,否则会报错,错误如下

    [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)

     
    现在再来看看npm start的速度,Windows也能飞起来了^_^
     
    参考stackoverflow上的帖子,它给出的是Mac下的方案,使用chmod 777来修改权限为读、写、删,对应Windows下我怀疑是只读,所以试了一下取消只读,居然可以了
     
     
    鉴于bit.ly被墙,这里我将watchman.zip上传到了博客园,可以点击这里直接下载>>
  • 相关阅读:
    java.util.Properties类
    java中log日志的使用(完全版)
    解读HDFS(转载)
    说明
    定时器中断和串口
    python day3
    python day2 基础总结:列表,元组,字典,集合
    python第二天作业:购物车
    作业总结:
    python第一天作业:用户登陆
  • 原文地址:https://www.cnblogs.com/meteoric_cry/p/5830535.html
Copyright © 2011-2022 走看看