【发布时间】:2018-04-06 10:03:19
【问题描述】:
所以当我打包一个电子应用程序后这个节点功能无法运行时,我遇到了一个问题,但在开发中该功能运行良好。 这是这样调用命令时提供的错误:
function run(){
try{
exc.compileExec();
}catch(e){
alert(e);
}
}
错误:cannot find module 'node-run-cmd'
exports.compileExec = function(){
var {remote} = require('electron');
const ref = remote.require("./main.js");
var nrc = require('node-run-cmd');
var commands = [
'file.exe'
];
var options = { cwd: 'Compiler' };
nrc.run(commands, options).then(function(){ ref.endResults(); });};
【问题讨论】:
-
有没有办法将这个问题提升到更明智的状态?
标签: javascript node.js runtime-error electron packaging