Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apple m1 throw error #152

Open
scZhengChao opened this issue Sep 22, 2022 · 1 comment
Open

apple m1 throw error #152

scZhengChao opened this issue Sep 22, 2022 · 1 comment

Comments

@scZhengChao
Copy link

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spawnSafeSync = void 0;
const cross_spawn_1 = require("cross-spawn");
const defaultOptions = {
logStdErrOnError: true,
throwOnError: true,
};
const spawnSafeSync = (command, args, options) => {
const mergedOptions = Object.assign({}, defaultOptions, options);
const result = cross_spawn_1.sync(command, args, options);
if (result.error || result.status !== 0) {
if (mergedOptions.logStdErrOnError) {
if (result.stderr) {
console.error(result.stderr.toString());
}
else if (result.error) {
console.error(result.error);
}
}
if (mergedOptions.throwOnError) {
throw result;
}
}
return result;
};
exports.spawnSafeSync = spawnSafeSync;

@chrystianrgs
Copy link

var http = require("http");

http.createServer(function (request, response) {
// Send the HTTP header
// HTTP Status: 200 : OK
// Content Type: text/plain
response.writeHead(200, {'Content-Type': 'text/plain'});

// Send the response body as "Hello World"
response.end('Hello World\n');

}).listen(8081);

// Console will print the message
console.log('Server running at http://127.0.0.1:8081/');
console.error('This is on STDERR');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants