zoukankan      html  css  js  c++  java
  • React-native 加载新项目的时候出错

    sudo react-native init FirstApp

     使用react-native加载新的项目的时候报错了!!!!

    npm WARN react-native@0.43.2 requires a peer of react@16.0.0-alpha.6 but none was installed.

    npm WARN You are using a pre-release version of node and things may not work as expected

    You are currently running Node v8.0.0-pre but React Native requires >=4. Please use a supported version of Node.

    See https://facebook.github.io/react-native/docs/getting-started.html

     ┌────────────────────────────────────────────────────────────────────────────┐ 

     │  You are currently running io.js v8.0.0-pre.                               │ 

     │                                                                            │ 

     │  React Native runs on Node 4.0 or newer. There are several ways to         │ 

     │  upgrade Node.js depending on your preference.                             │ 

     │                                                                            │ 

     │  nvm:       nvm install node && nvm alias default node                     │ 

     │  Homebrew:  brew unlink iojs; brew install node                            │ 

     │  Installer: download the Mac .pkg from https://nodejs.org/                 │ 

     │                                                                            │ 

     │  About Node.js:   https://nodejs.org                                       │ 

     │  Follow along at: https://github.com/facebook/react-native/issues/2545   

    原因是我的mac在没有安装react-native之前已经下载了一个v8.0.0.0 pre 版本的node.js。

    现在看来应该node的版本和react-native的版本不兼容。

    所以,我决定安装它的要求安装一个 4.0 版本以上的node.js给它。

    然后我用HomeBrew的管理器下载node(HomeBrew相关使用请百度)

    brew install node    

    当它成功下载完了后,发出了以下的错误:

    这张图的意思就是说 现在下载的node版本 软连接到 当前版本的node失败了。但是它给出了如果将下载的版本软连接到当前版本。

    rm /usr/local/bin/node  // 移除当前版本的node

    注意:如果有权限限制问题,就在命令行前面加上 sudo

    sudo brew link --overwrite node
    brew link --overwrite --dry-run node

    然后在命令行输入:node 进行测试!完成!

  • 相关阅读:
    Windows 7下 搭建 基于 ssh 的sftp 服务器
    理解ThreadLocal(二)
    理解ThreadLocal(一)
    Putty使用公钥认证时,报错:Disconnected: No supported authentication methods available(server sent:public key) 问题的解决
    SFTP信任公钥配置及JSCH库
    怎样在WIN7系统下安装IIS
    深入研究B树索引(一)
    【转】EntityFramework(EF)贪婪加载和延迟加载的选择和使用
    【转】Ext JS 集合1713个icon图标的CSS文件
    [转]ASP.NET MVC 4 最佳实践宝典
  • 原文地址:https://www.cnblogs.com/tjc1996/p/6684892.html
Copyright © 2011-2022 走看看