callstack / callstack/masked-view

index.js file missing from node_modules\@react-native-community\masked-view after installation.

Open
#82 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
131
PR merge metrics
No merged PRs in 30d

Description

I am getting this below error while building react-native app. @react-native-community/masked-view and @react-navigation\stack are up to date but not sure why this package is not being resolved while building.

```
error: Error: While trying to resolve module `@react-native-community/masked-view` from file `C:\..\..\node_
modules\@react-navigation\stack\src\views\MaskedViewNative.tsx`, the package `C:\..\..\node_modules\@react-n
ative-community\masked-view\package.json` was successfully found. However, this package itself specifies a `main` module
field that could not be resolved (`C:\..\..\node_modules\@react-native-community\masked-view\index.js`. Indeed, none of these files exist:

my package.json

{
"name": "appname",
"version": "0.0.1",
"private": true,
"scripts": {
..
},
"dependencies": {
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-firebase/app": "^8.4.6",
"@react-native-firebase/auth": "^9.3.1",
"@react-native-firebase/firestore": "^7.8.7",
"@react-native-firebase/functions": "^7.4.9",
"@react-native-firebase/storage": "^7.4.10",
"@react-navigation/bottom-tabs": "5.10.2",
"@react-navigation/drawer": "5.10.2",
"@react-navigation/material-top-tabs": "5.3.2",
"@react-navigation/native": "5.8.2",
"@react-navigation/stack": "5.11.1",
"@reduxjs/toolkit": "^1.4.0",
"axios": "^0.19.2",
"lodash": "^4.17.19",
"moment": "^2.27.0",
"react": "16.13.1",
"react-native": "0.63.2",
"react-native-animatable": "^1.3.3",
"react-native-fast-image": "^8.3.2",
"react-native-gesture-handler": "^1.7.0",
"react-native-global-props": "^1.1.5",
"react-native-keyboard-aware-scroll-view": "^0.9.2",
"react-native-paper": "^4.0.1",
"react-native-reanimated": "^1.10.1",
"react-native-safe-area-context": "^3.1.1",
"react-native-screens": "^2.9.0",
"react-native-spinkit": "^1.5.0",
"react-native-vector-icons": "^7.0.0",
"react-redux": "^7.2.1"
},
"devDependencies": {
...
},
"jest": {
"preset": "react-native"
}
}
```
**Temporary solution:**

I have tried uninstalling @react-native-community/masked-view a few times. I have tried deleting node modules folder, clearing cache using commands like npm cache clean --force, react-native start --reset-cache but nothing worked so far.

Then I realized @react-native-community/masked-view package is missing index.js file from installation.

I copied js folder and index.js file from another project for @react-native-community/masked-view and project starts building again.

![image](https://user-images.githubusercontent.com/33188672/97795763-f951cd00-1bcf-11eb-8949-15edbea7c37c.png)

I am not sure why this folder and index file is missing from the installation itself.

Any help on this issue is much appreciated.
note: I opened up this issue on [stackoverflow](https://stackoverflow.com/questions/64625169/react-native-index-js-file-missing-from-node-modules-react-native-community-ma) before finding temp solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.