找不到模块:无法解析“/app/node_modules/react-native-aes-crypto”中的 'react-native'
Module not found: Can't resolve 'react-native' in '/app/node_modules/react-native-aes-crypto'
我想使用 react-native-aes-crypto
但它需要 react-native
。我安装了,它一直说找不到。
我已经尝试重新安装它,添加他的依赖项但没有任何效果。
我的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"
}
}
当我执行 import Aes from 'react-native-aes-crypto'
时出现错误
更新 1:
我已经尝试将 react-native 的版本更改为 0.55.0,不再需要进行审计修复,但它显示相同的错误。
安装软件包 react-native-cli
以修复该问题。
如果您想要另一个不需要 react-native 的包,请使用 simple-encryptor
。
我想使用 react-native-aes-crypto
但它需要 react-native
。我安装了,它一直说找不到。
我已经尝试重新安装它,添加他的依赖项但没有任何效果。
我的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"
}
}
当我执行 import Aes from 'react-native-aes-crypto'
更新 1:
我已经尝试将 react-native 的版本更改为 0.55.0,不再需要进行审计修复,但它显示相同的错误。
安装软件包 react-native-cli
以修复该问题。
如果您想要另一个不需要 react-native 的包,请使用 simple-encryptor
。