react-native - 当我运行“npx react-native init AwesomeProject”时,我得到“react-native”未被识别为内部或外部命令
问题描述
我已经使用巧克力安装了节点和 jdk8。
当我遵循官方指南“设置开发环境 - > React Native ClI Quick start for 'Windows & Android'”时,我在运行npx react-native init AwesomeProject
命令时收到以下错误:
'react-native' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code 1
npm ERR! path E:\UOG\React_Native_Projects\MyFirstApp
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c react-native init AwesomeProject
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Muhammad Suleman\AppData\Local\npm-cache\_logs\2021-01-23T09_10_07_360Z-debug.log
解决方案
运行此命令
npm install -g react-native-cli
之后,只需将您的 npm 路径添加到环境变量中的系统变量
C:\Users\您的用户名\AppData\Roaming\npm
推荐阅读
- javascript - 如何访问反应路由器钩子useHistory()上历史记录中的所有URL
- flutter - 替换重复字段以消除 - Flutter Form Builder 错误
- javascript - document.getElementById 使用织物 js 做出反应
- python - get_payload() 不适用于 eml 格式的附件
- azure - 我们可以为 Azure AD B2C OTP 自定义 SMS 模板吗
- c - 按位拆分 IEEE 754 双的尾数?如何访问位结构,
- jpa - 在 intellij 中安装 3party 插件时,您是否有风险让它们访问您的源代码
- java - filenet JAVA API 保留期未更新
- chart.js - Chartjs:根据背景颜色自定义图例
- vue.js - 是否可以使用 Vue Buefy 自动完成作为搜索选择?