![](/img/trans.png)
[英]What are the benefits of installing node, react-native, npm and expo do your desktop when you can just code in expo snack? [on hold]
[英]React native with Yarn or NPM is not finding @expo/bunyan. What I have to do?
我尝试使用React Native创建一个应用程序,当我使用命令create-react-native-app时,找不到库@ expo / bunyan。 我试图清理npm缓存,更改了npm注册表,但是仍然出现错误。 那是日志。
Arguments:
/usr/local/bin/node /usr/local/Cellar/yarn/1.5.1_1/libexec/bin/yarn.js add --dev --exact --ignore-optio$
PATH:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Frameworks/Mono.framework/Versi$
Yarn version:
1.5.1
Node version:
8.10.0
Platform:
darwin x64
npm manifest:
{
"name": "Tes",
"version": "0.1.0",
"private": true
}
yarn manifest:
No manifest
Lockfile:
No lockfile
Trace:
Error: Couldn't find package "@expo/bunyan@1.8.10" required by "react-native-scripts" on the "npm" regi$
at new MessageError (/usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:186:110)
at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:36274:17)
at Generator.throw (<anonymous>)
at step (/usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:98:30)
at /usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:111:13
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
由于npm5
有问题,因此create-react-native-app
目前不支持npm5
。 您可以使用npm4
或最新的npm
稳定版本。
我尝试在具有以下配置的系统上安装create-react-native-app
库:
节点-v
v9.4.0
npm -v
5.6.0
在安装之前,请先删除node_modules
并清除npm-cache
。
使用npm config set registry http://registry.npmjs.org/
命令设置npm注册表。
然后尝试使用npm i react-native-scripts --save --use-npm --verbose
命令进行安装。
如果要使用yarn安装相同的库,则可以使用yarn global add create-react-native-app
命令。
希望这个能对您有所帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.