Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Requiring unknown module "11" error on iOS simulator

When I run the react native project with react-native run-ios.It shows the following error on my iOS simulator.On my android simulator, it is totally ok.I have deleted node module and reinstalled.But the error is still there.I don't want to entirely delete my ios/build folder since I have manually added library dependencies in there and that third party libraries were working properly in my react native project.Can someone help me with this?

Error Message

Requiring unknown module "11".If you are sure the module is there, try restarting Metro Bundler.You may also want to run yarn or npm install( depending on your environment ).

Error Message on iOS

package.json

{
  "name": "AwwsomeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-navigation": "^1.1.473",
    "react-native-vector-icons": "^4.6.0"
  },
  "devDependencies": {
    "babel-jest": "23.2.0",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.2.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}
like image 692
Min Htet Oo Avatar asked Jun 29 '18 03:06

Min Htet Oo


5 Answers

Restarting packager fixed my issue.

like image 61
Mert Doe Avatar answered Nov 09 '22 00:11

Mert Doe


I fixed the issue with the instructions from the following page:

https://facebook.github.io/react-native/docs/troubleshooting#content

Basically it asks you to terminate the processes running on a specific port.

Run the following command to find the id for the process that is listening on port 8081:

$ sudo lsof -i :8081

Then run the following to terminate the process:

$ kill -9 <PID> 
like image 43
Yun Li Avatar answered Nov 09 '22 00:11

Yun Li


I just killed all node processes

killall node

🙌 and launched again

like image 2
Anton Liannoi Avatar answered Nov 09 '22 00:11

Anton Liannoi


I had the same problem. Running npm install or yarn install should fix the issue.

like image 1
Nuno Martins Avatar answered Nov 09 '22 00:11

Nuno Martins


I had the same problem while working with my react native app and expo. Same screen with 'Requiring Unknown Module 1".

This is how I fixed it:

  • I closed Expo
  • I closed the Metro bundler on my local host
  • I closed the packager on my terminal with Ctlr + C
  • I restarted with npm start
  • I relaunched the project on Expo.

It worked for me.

like image 1
Enora Avatar answered Nov 08 '22 23:11

Enora