无法parsing模块“react”

我克隆了https://github.com/oblador/react-native-progress

在示例文件夹上:

npm i react-native run-ios 

但是我得到一个错误,这是错误screenshoot链接: Unable to resolve module react

这是代码:

 import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Animated, Easing, View, ViewPropTypes, } from 'react-native'; 

为什么我的react模块不能解决,但react native模块可以?

示例在package.json文件中构build节点依赖关系时出错

  "dependencies": { "react": "16.0.0-alpha.12", "react-native": "0.47.2", "react-native-progress": "file:../" // error }, 

解决这个问题

  1. 在示例文件夹内运行npm uninstall react-native-progress
  2. 卸载后运行npm install react-native-progress --save

然后正常运行您的示例应用程序