我克隆了https://github.com/oblador/react-native-progress
在示例文件夹中:
npm i
react-native run-ios
但是我收到了错误,这是错误的屏幕截图链接: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
模块无法解决?
答案 0 :(得分:1)
示例在package.json
文件
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.47.2",
"react-native-progress": "file:../" // error
},
修复
npm uninstall react-native-progress
npm install react-native-progress --save
然后正常运行您的示例应用