NodeJS - SyntaxError:意外的标记ILLEGAL

iam*_*in. 1 ubuntu instance node.js npm

我在大学服务器上创建了一个ubuntu实例.我已经安装了NodeJS和NPM,可以通过FTP连接发送文件.

我将以下NodeJS webserver文件发送到我的intance并希望在实例ip-adress上运行它.

var http = require(“http“);
http.createServer(function(request, response) {
    response.writeHead(200, {‚content-type’: ‚text/plain‚});
    response.write(‘Hello World’);
    response.end;
}).listen(3000‚141.28.107.7);
console.log(“server is running“);
Run Code Online (Sandbox Code Playgroud)

当我运行此文件时

sudo nodejs server.js
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息:

sudo: unable to resolve host nodejs
/home/robin/files/webserver.js:1
(function (exports, require, module, __filename, __dirname) { var http = require(“http“);
                                                                                 ^

SyntaxError: Unexpected token ILLEGAL
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:148:18)
    at node.js:405:3
Run Code Online (Sandbox Code Playgroud)

我在推理中的错误在哪里?谢谢!

top*_*man 6

你似乎在使用奇怪的引语:.使用标准双引号"或单引号'.

var http = require('http');
http.createServer(function(request, response) {
    response.writeHead(200, {'Content-Type': 'text/plain'});
    response.write('Hello World');
    response.end();
}).listen(3000‚'141.28.107.7');
console.log('server is running');
Run Code Online (Sandbox Code Playgroud)