找不到模块:无法解析“/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
.我安装了它,但它继续说找不到它.
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.
我的 package.json:
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"
}
}
当我执行 import Aes from 'react-native-aes-crypto'
更新1:
我已尝试将 react-native 的版本更改为 0.55.0,无需进行更多审核修复,但显示相同的错误.
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.
推荐答案
安装包 react-native-cli
来解决这个问题.
Install the package react-native-cli
for fix that.
如果您想要另一个不需要 react-native 的包,请使用 simple-encryptor
.
If you want an another package who doesn't require react-native, use simple-encryptor
.
这篇关于找不到模块:无法解析“/app/node_modules/react-native-aes-crypto"中的“react-native"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!