0

I am trying to set up nodejs with atom on ubuntu 16.10. I followed the steps given in this link. But when I edit the ~/.atom/config.cson file to

runner:

scopes:

js:”nodejs”

as given in the link, Atom gives an error

Unexpected new line after runner:

How do I get this correct?



EDIT
After using Dan Lowe's code, the atom error disappeared but the code doesnt compile.

#!/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/');

It gives the error

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

Is it not able to see nodejs?

2

1 Answer 1

1

If this is the actual config you are using, you have two problems.

  1. The lines are not indented.

  2. Around nodejs are smart-quotes, not normal double quotes. That is not valid syntax here.

You probably want this instead.

runner:
  scopes:
    js: "nodejs"
Sign up to request clarification or add additional context in comments.

1 Comment

The error doesn' come now. But the simple programe that I added in the edit won't even compile. I am not sure it is able to see nodejs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.