当我使用Xcode构建具有发布部署的项目时,运行shell脚本失败。

时间:2016-09-01 14:35:32

标签: ios node.js xcode shell

问题描述

构建项目如下所示的错误日志。

  • node /Users/niyao/Company/Projects/EVE/EVERN/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false - -reset-cache --bundle-output /Users/niyao/Library/Developer/Xcode/DerivedData/EVE-bzggtbnrxixkvwgqyewmpxepvljo/Build/Products/Release-iphonesimulator/EVE.app/main.jsbundle-assets-dest / Users / niyao /Library/Developer/Xcode/DerivedData/EVE-bzggtbnrxixkvwgqyewmpxepvljo/Build/Products/Release-iphonesimulator/EVE.app

fs.js:584   return binding.open(pathModule._makeLong(path),stringToFlags(flags),mode);

错误:ENOENT:没有这样的文件或目录,打开'package.json'

错误情景

在我使用如下的package.json到npm instal new version之后,错误发生在发布部署方案中。

{
  "name": "NYProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "lint": "./node_modules/eslint/bin/eslint.js index.ios.js index.android.js react/",
    "watch": "npm-watch"
  },
  "watch": {
    "lint": {
      "patterns": [
        "react",
        "index.ios.js",
        "index.android.js"
      ],
      "extensions": "js",
      "ignore": ".node_modules",
      "quiet": false
    }
  },
  "dependencies": {
    "react": "15.3.1",
    "react-native": "^0.32.0",
    "react-redux": "^4.4.5",
    "redux": "^3.5.2",
    "redux-logger": "^2.6.1",
    "redux-thunk": "^2.1.0"
  },
  "devDependencies": {
    "babel-eslint": "^6.1.2",
    "eslint": "^3.3.1",
    "eslint-plugin-react": "^6.1.2",
    "eslint-plugin-react-native": "^2.0.0",
    "npm-watch": "^0.1.6"
  }
}

发布 构建配置中构建项目时,shell运行失败。

“./ NYProject / node_modules /反应天然/打包器/ react-native-xcode.sh”

预期成绩

Xcode可以在构建项目时运行shell。在升级package.json配置之前,它确实成功运行。

其他信息

  • React Native版本: react-native-cli:0.2.0 react-native:0.32.0
  • 平台(iOS,Android或两者?): Xcode 7.3.1 iOS
  • 操作系统(macOS,Linux或Windows?): OS X 10.11

1 个答案:

答案 0 :(得分:0)

我有同样的问题,对我来说,只需升级到react-native 0.33.0即可解决问题。