在终端中,当我尝试运行% node example.js时,为什么会得到-bash: fg: %: no such job
我已经安装了Node.js。我已经用示例代码保存了example.js:
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/');这是遵循http://nodejs.org/登录页面上的the服务器示例。
发布于 2014-07-23 03:52:36
在没有%的情况下,可以成功运行node example.js。
node example.js结果为:Server running at http://127.0.0.1:1337/
%用于定义作业,它需要一个作业标识符(数字、字符串等)。我还认为在那个网站上他们使用了%作为提示符。尝试使用node example.js - Jidder
图片来源:Jidder
发布于 2019-05-16 20:57:53
%经常用作提示符,在mongolab中运行mongo shell命令时,我遇到了类似的情况。
在%之后运行命令。
https://stackoverflow.com/questions/24880989
复制相似问题