gpt4 book ai didi

react-native - 为什么 react-Native 不起作用 ubuntu 20.04

转载 作者:行者123 更新时间:2023-12-04 18:43:58 25 4
gpt4 key购买 nike

当我尝试使用 npm 安装时,我得到以下控制台用语

 guilherme@guilherme-Aspire-A515-52G:~$  npm install -g react-native-cli  npm WARN checkPermissions Missing write access to /usr/local/lib npm ERR! code EACCES npm ERR! syscall access npm ERR! path /usr/local/lib npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, access '/usr/local/lib' npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib'] npm ERR!   stack: npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib\'', npm ERR!   errno: -13, npm ERR!   code: 'EACCES', npm ERR!   syscall: 'access', npm ERR!   path: '/usr/local/lib' } npm ERR!  npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR!  npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: npm ERR! /home/guilherme/.npm/_logs/2020-06-17T23_39_26_149Z-debug.log guilherme@guilherme-Aspire-A515-52G:~$ ^C guilherme@guilherme-Aspire-A515-52G:~$

所以我尝试使用 yarn并且有效,但不是 100%
因为,这一次当我写
react-native init myProject 

我收到如下错误:

return command not found!



对此的任何帮助将不胜感激。

最佳答案

Mano, eu uso a cli do expo, e até agora ta me servindo bem, da uma olhada na documentação, é bem simples https://expo.io/learn

安装 a o expo cli:

npm install expo-cli --global

Cria um 项目:
expo init nomeDoSeuApp

Entra na意大利面:
cd nomeDoSeuApp

E da um start na servidor :
expo start 

Se estiver usando um simulador android, depois que aparecer o qr code no terminal da um a que ele ja inicia o app no seu simulador

我正在使用 expo cli,它一直很好地为我服务,看看文档 https://expo.io/learn .

首先,全局安装:
npm install expo-cli --global

创建一个项目:
expo init nameOfYourApp

进入文件夹:
cd nameOfYourApp

启动服务器:
expo start 

如果您使用的是安卓模拟器,请输入 a二维码显示在终端后,应用程序将在模拟器上自动启动。

关于react-native - 为什么 react-Native 不起作用 ubuntu 20.04,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62440208/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com