In my React Native project react: 16.8.3 => 16.8.3 - react-native: ^0.59.5 => 0.59.10
I updated the react-redux
for using the hooks from the version 5.xx
to 7.1.3
and since the update I'm getting an error with prop-types dependency.
error: bundling failed: Error: Unable to resolve module '../utils/PropTypes' from '/node_modules/react-redux/lib/components/Provider.js': The module '../utils/PropTypes' could not be found from '/node_modules/react-redux/lib/components/Provider.js'.
Indeed, none of these files exist:I already installed the prop-types dependency manually and it does not help me.
It looks like you've already got propTypes there. What you can try, and what worked for me is doing both of the following.
Step 1 : npm ci
this will remove node_modules
and reinstall with the correct 'acceptable' deps from your packages.json
Then you'll need to get clear the React Native packager cache .
Step 2:
With Expo, this can be done either of two ways:
npm start
(which is expo start
) and in the same terminal press Shift + r
which will reset cache and restart bundlerexpo start --clear
which will clear the expo cacheThis should work, the typical watchmen reset:
npm start -- --reset-cache
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-*
这对我有帮助: npm start -- --reset-cache
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.