This is my package.json
{
"name": "Locals",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"@babel/runtime": "^7.3.1",
"react": "16.6.3",
"react-native": "0.58.3",
"react-native-elements": "^1.0.0",
"react-native-vector-icons": "^6.2.0"
},
"devDependencies": {
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "24.0.0",
"jest": "24.0.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
And I get following logs of failure:
Loading dependency graph, done. error: bundling failed: Error: Cannot find module 'NativeModules' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.get NativeModules [as NativeModules] (/Users/vb05mj/Developer/personal/small-town/Locals/node_modules/react-native/Libraries/react-native/react-native-implementation.js:313:12) at Object.get [as NativeModules] (/Users/vb05mj/Developer/personal/small-town/Locals/node_modules/react-native-vector-icons/dist/lib/react-native.js:1:344) at Object. (/Users/vb05mj/Developer/personal/small-town/Locals/node_modules/react-native-vector-icons/dist/lib/ensure-native-module-available.js:1:238) at Module._compile (internal/modules/cjs/loader.js:689:30)
npm install react-native-vector-icons --save
, and then link it as a native dependency withreact-native link react-native-vector-icons
– steverreact-native unlink react-native-vector-icons && npm remove react-native-vector-icons
and try reinstalling (making sure I usednpm install react-native-vector-icons --save
andreact-native link react-native-vector-icons
– stever