因此,我在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上添加所有本地依赖项,然后只复制我的代码,或者这应该没问题,还有其他问题.
如果我能在不重新添加依赖项的情况下解决这个问题,那就太好了.提前谢谢.