2017-04-24 53 views
0

的NodeJS我试图建立与原子的NodeJS在Ubuntu 16.10原子。我遵循this link中给出的步骤。但是,当我编辑~/.atom/config.cson文件错误settting了在Ubuntu

runner: 

scopes: 

js:”nodejs” 

为链接给出凌给出了一个错误

Unexpected new line after runner: 

我如何得到这正确吗?



编辑
使用丹Lowe的代码后,原子错误消失了,但代码犯规编译。

#!/usr/bin/env nodejs 
var http = require('http'); 
http.createServer(function (req, res) { 
    res.writeHead(200, {'Content-Type': 'text/plain'}); 
    res.end('Hello World\n'); 
}).listen(8080, 'localhost'); 
console.log('Server running at http://localhost:8080/'); 

它给人的错误

./server.js: line 3: syntax error near unexpected token `(' 
./server.js: line 3: `var http = require('http');' 

它是无法看到的NodeJS?

+0

IMO,此编辑大概应该是一个单独的问题。现在你已经转向完全不同的情况/问题。 –

+0

@DanLowe:完成 - http://stackoverflow.com/questions/43580416/error-when-running-nodejs – Ashwin

回答

1

如果这是您正在使用的实际配置,你有两个问题。

  1. 这些行不缩进。

  2. 围绕nodejs是智能引号,而不是正常的双引号。这在这里是无效的语法。

你可能想要这个。

runner: 
    scopes: 
    js: "nodejs" 
+0

错误没有按”现在就来。但是我在编辑中添加的简单程序不会编译。我不确定它能够看到nodejs。 – Ashwin