查询者不响应键盘输入

时间:2019-05-09 07:30:49

标签: javascript node.js reactjs react-native inquirer

我正在与查询者一起从用户那里获取输入,但是就我在单个流程中进行工作而言,它工作正常。但是在我的项目中,我必须从主项目中的子项目中调用另一个脚本,但查询者无法使用该脚本。

我的主项目的package.json

{
  "name": "AppConfigurator",
  "version": "28.0.9",
  "private": true,
  "scripts": {
    "start": "node ./app-building"
  },
  "dependencies": {
    "fs-extra": "^7.0.1",
    "node-run-cmd": "^1.0.1"
  },
  "devDependencies": {
    "csv-parse": "1.2.0",
    "inquirer": "1.1.2",
    "mime-types": "2.1.15",
    "mkdirp": "0.5.1",
    "standard": "8.6.0"
  }
}

当我运行npm run start时,查询程序运行良好,但是执行了一些步骤之后,我正在使用node-run-cmd从代码执行另一个节点脚本。

nrc.run('npm run env',{ verbose: true }).then(function(exitCodes) {
              console.log("#### Exit Codes #### : ", exitCodes)
            }, function(err) { 
              console.log('#### Command failed to run with error #### : ', err);
});

这指向另一个子项目中的另一个package.jsonpackage.json用于子项目。

{
  "name": "CPP",
  "version": "28.0.9",
  "private": true,
  "scripts": {
    "env": "node ./appBuild/index",
  },
  "dependencies": {
  },
  "devDependencies": {
    "aws-sdk": "2.75.0",
    "babel-jest": "*",
    "babel-plugin-transform-inline-environment-variables": "0.0.2",
    "babel-plugin-transform-remove-console": "6.8.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react-native": "*",
    "babel-register": "^6.26.0",
    "babel-remove-process-env-assignment": "0.0.2",
    "csv-parse": "1.2.0",
    "inquirer": "1.1.2",
    "jest": "*",
    "jscodeshift": "0.3.32",
    "mime-types": "2.1.15",
    "mkdirp": "0.5.1",
    "react-native-mock": "^0.3.1",
    "react-test-renderer": "*",
    "redux-logger": "3.0.1",
    "remote-redux-devtools": "0.5.12",
    "standard": "8.6.0"
  },
  }
}

现在inquirer文件中的appbuild/index.js对输入没有响应。

enter image description here

我假设两个查询者都在不同的节点或不同的进程上执行。这就是为什么发生这种情况。

但是我是Node的新手,所以会做出本地反应。因此无法找出解决方案。 任何帮助都应感谢。

0 个答案:

没有答案