我有这样的功能
if (isset(get_headers("www.websitedoesntexist.com"))) {
echo "URL Exists";
}
在Windows,Linux和Android机器上,我有同样的错误:在尝试执行npm时ENOENT。它出现在process.env.PATH中。我做错了什么?
P.S。 function startMain(){
child_process.spawn(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['install'], {
cwd : somedir,
stdio : 'inherit'
}).on('close',()=>{
child_process.spawn('node', ['app'], {
cwd : somedir,
stdio : 'inherit'
}).on('error', (err)=>{
console.log('Error occured during starting. Aborting...\nError stack: Cannot exec node\n');
throw(err); // something wrong with spawn
});
}).on('error', (err)=>{
console.log('Error occured during starting. Aborting...\nError stack: Cannot exec npm\n');
throw(err); // something wrong with spawn
});
}
已定义且等于现有目录
答案 0 :(得分:1)
对不起,伙计们,这是我的错。 somedir
并不存在。结束问题