简体   繁体   English

我无法创建本机项目吗?

[英]I can't create a react-native project?

I installed react native cli and other packages, but can't create a react native project? 我安装了react native cli和其他软件包,但是无法创建react native项目?

-bash: react-native: command not found -bash:react-native:找不到命令

我的终端进程屏幕截图已添加。

You have to install react native cli in global. 您必须在global中安装react native cli。 You can use this to do that 你可以用它来做

npm install react-native-cli -g

I was having a lot of trouble with this, as none of the other answers provided were working. 我遇到了很多麻烦,因为提供的其他答案都没有用。 The top answer here was what allowed me to get through my problem: npm global path prefix . 最好的答案是让我解决问题的方法: npm global path prefix

If you get a subsequent EACCES permissions problem, use this so as to not having to go back to square one to fiddle with the npm default directory again: 如果遇到后续的EACCES权限问题,请使用此方法,以免再次回到npm默认目录的位置:

sudo npm install -g --unsafe-perm=true --allow-root

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM