我正在尝试将node.js应用程序转换为Ember Electron应用程序。在我使用的node.js应用程序中: const spawn = require('child_process').spawnSync; 但不知道如何将'child_process‘导入Ember Electron应用程序。已经尝试过: import { child_process } from 'child_process'; // blows up: requireNode is not a function 还有: import requireModule from &
如何使用child_process应用程序中的“ReactJS”模块?
(react@16.3.1 / Linux)
这些语法失败:
import { spawn } from 'child_process'
const ls = spawn('ls', ['-al']);
收益率:TypeError: Object(...) is not a function
import cp from 'child_process';
const ls = cp.spawn('ls', ['-al']);
收
child_process模块实现的状态。因此,我正在尝试派生一个子进程并将数据写入其中,如中所述
var child_process = require("sdk/system/child_process");
var doiuse = child_process.spawn("/usr/local/bin/doiuse");
doiuse.stdin.write(data);
但是我得到了这个错误:
TypeError: doiuse.stdin.write is not a function
那么,如何在Firefox Add-on SDK中写入子进程呢
我想使用child_process模块从node.js运行脚本,但是当我运行命令时
npm安装child_process我得到以下错误:
npm http GET https://registry.npmjs.org/ChildProcess
npm http 404 https://registry.npmjs.org/ChildProcess
npm ERR! 404 'ChildProcess' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
只是想知
var exec = require('child_process') // exec type is any
import ch from 'child_process'; // ch type is child process
为什么我在打字项目中会有这种差异?
应该在项目中使用哪一种?