In Terminal, when I try to run % node example.js why do I get -bash: fg: %: no such job?
I've installed Node.js. I've saved example.js with the example code:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
This is following the webserver example on the landing page of http://nodejs.org/.
Running node example.js is successful without the %.
node example.js results in:
Server running at http://127.0.0.1:1337/
% is used to define a job, it expects a job identifier(number,string,etc) after it. Also i think on that website they are using % as the prompt. Try just node example.js – Jidder
Credit: Jidder