reactjsreact-nativeaescryptoserviceprovider

Module not found: Can't resolve 'react-native' in '/app/node_modules/react-native-aes-crypto'


I want to use react-native-aes-crypto but it need react-native. I install it but it continue to say that it can't find it.

I have try to reinstall it, add his dependencies but nothing work.

My package.json:

{
  "name": "neko_web",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@fortawesome/fontawesome": "^1.1.8",
    "@fortawesome/react-fontawesome": "0.0.20",
    "@trendmicro/react-sidenav": "^0.4.5",
    "ajv": "^6.5.1",
    "create-react-app": "^1.5.2",
    "font-awesome": "^4.7.0",
    "moment": "^2.22.2",
    "react": "16.3.1",
    "react-cookie": "^2.2.0",
    "react-dom": "^16.4.0",
    "react-icons-kit": "^1.1.5",
    "react-moment": "^0.7.7",
    "react-native": "^0.55.4",
    "react-native-aes-crypto": "^1.2.1",
    "react-router-dom": "^4.3.1",
    "react-scripts": "1.1.4",
    "react-sidenav": "^2.1.3"
  },
  "scripts": {
    "start": "PORT=3005 react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

The error is getting when I do import Aes from 'react-native-aes-crypto'

UPDATE 1:
I have tried to change version of react-native to 0.55.0, no more audit fix to do but it display the same error.


Solution

  • Install the package react-native-cli for fix that.

    If you want an another package who doesn't require react-native, use simple-encryptor.