편집 :이 질문에 신경 쓰지 마세요. 검토 대기 중입니다.자바 스크립트에서 V8 컴파일 오류가 발생했습니다.
나는 다음을 컴파일 할 수 없습니다 :
var argStr = arguments[0];
var options = {};
if (argStr){
options = JSON.parse(argStr);
}
options.cb = function(port){
// Send the port back to the master so that
process.send({
pid: process.pid,
type: 'init',
port: port
});
};
require('./x2ProxyService')(options);
노드는 다음과 같은 오류
SyntaxError: Unexpected token o
at Object.parse (native)
at Object.<anonymous> (E:\formwork\FRFcour\portal\controller\fwProxyServerLaunch.js:5:17)
at Module._compile (module.js:456:26)
그것은 "JSON"에 실패한 것으로 나타납니다하지만 난 이유를 모른다에게 제공합니다.
은 argStr 유효 JSON입니까? – tymeJV
내 부분에 총 실패. 모듈이 child_process로 호출되었지만 --debug-brk가 올바르게 전달되지 않았습니다. 그래서 프로세스는 디버거를 기다리지 않고 .parse()에 전달 된 값은 실제로 유효하지 않습니다. 나는 열 번호가 재미있는 위치를 지적했기 때문에 컴파일 오류로 인한 것이지만 말이다. 그것은 나쁜 질문이며 제거되어야합니다. –