因此,我在ReactNative中获得了第一个在Windows for Android操作系统上运行的项目.在Mac上进行签出,以相同的方式进行配置,当我try 使用react-native start启动react package manager时,出现以下错误:

child_process.js:506
    throw err;
    ^
Error: spawnSync /Users/UserName/Desktop/Path/node_modules/react-native/local-cli/setup_env.sh EACCES
    at exports._errnoException (util.js:1022:11)
    at spawnSync (child_process.js:461:20)
    at Object.execFileSync (child_process.js:498:13)
    at Object.run (/Users/UserName/Desktop/Path/node_modules/react-native/local-cli/cliEntry.js:156:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:117:7)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

我知道它只会try 将ulimit(开放文件限制)设置为2048,这对非root用户是允许的.还try 使用sudo运行该命令,并授予其root权限.

使用react-native init DemoProject创建了一个新项目,而打包机似乎是从该文件夹中开始的,所以问题是别的吗?

我的Package.json是:

{
  "name": "React Native",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "native-base": "^0.5.18",
    "react": "15.4.1",
    "react-addons-shallow-compare": "^15.4.1",
    "react-native": "0.39.2",
    "react-native-drawer": "^2.3.0",
    "react-native-icons": "^0.7.1",
    "react-native-loading-spinner-overlay": "^0.4.1",
    "react-native-md-textinput": "^2.0.4",
    "react-native-overlay": "^0.5.0",
    "react-native-scrollable-tab-view": "^0.7.0",
    "react-native-tab-view": "0.0.40",
    "react-redux": "^4.4.6",
    "react-timer-mixin": "^0.13.3",
    "redux": "^3.6.0"
  },
  "devDependencies": {
    "babel-jest": "17.0.2",
    "babel-preset-react-native": "1.9.0",
    "jest": "17.0.3",
    "react-test-renderer": "15.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

此外,如果有关系的话,我在全球安装了sinopia、browserify和Thread.

首先,我不确定我是否应该再次通过npm在Mac上添加所有本地依赖项,然后只复制我的代码,或者这应该没问题,还有其他问题.

如果我能在不重新添加依赖项的情况下解决这个问题,那就太好了.提前谢谢.

推荐答案

只需转到我的基本项目目录并运行

chmod -R 777 node_modules

React-native相关问答推荐

错误:HostFunction 中的异常: Malformed calls from JS: field sizes are different. In an Animated View

_react2.default.PropTypes.function 未定义

从 .apk 到 .aab 的本地构建版本react,如何将应用程序发送给客户端?

命令失败:gradlew.bat installDebug error whenever installing dependencies like navigation, firebase, icons etc in React-Native

React Native 错误找不到模块metro-config/src/defaults/blacklist

如何在 react-native 中在图像周围添加阴影

React Native localhost 另一个调试器已经连接

React-Native 构建失败的应用程序:mergeDebugAssets

React Navigation - 标题的渐变 colored颜色

如何在 ubuntu 上安装 facebook watchman?

如何在我的 React Native Android 应用程序中显示当前的 CodePush 版本标签?

如何将时刻日期转换为字符串并删除时刻对象

DeviceInfo 原生模块未正确安装

在 FlatList 上使用 React Native 搜索过滤器

如何在 React Native 中重复图案图像以创建背景?

React Native:如何将文件拆分为多个文件并导入它们?

在 ReactNative 中单击按钮时如何获取 TextInput 中的值

如何为 TouchableOpacity 组件创建禁用样式?

当前未启用语法nullishCoalescingOperator

在 React Native 中向组件传递参数