atom-tern
atom-tern copied to clipboard
Tern errors on Atom Windows build
I am not sure if its tern plugin or windows alpha build problem, tern fails with those errors.
Same here, it says "Uncaught TypeError: Cannot read property 'update' of null"
Windows 7 64bit Atom 0.138.0
Change BufferedNodeProcess to BufferedProcess in Tern/lib/server.coffee should fix that error.
Well, after changing anhhh11's suggestion, I got this: "Uncaught ReferenceError: BufferedProcess is not defined"
server.coffee after editing:
{BufferedProcess} = require 'atom'
module.exports = ->
process = null
start = (cb)->
path = require 'path'
command = path.resolve __dirname, "../node_modules/.bin/tern"
console.log command
args = ["--persistent", "--no-port-file","--verbose"]
stderr = (output) -> console.error output
stdout = (output) ->
output = output.split(" ")
port = output[output.length - 1]
console.log "Tern server running on port #{port}"
cb port
options =
cwd: atom.project.getRootDirectory().getPath()
console.log(options);
exit = (code) ->
console.log("tern exited with code: #{code}")
process = new BufferedProcess {command, args, options, stdout, stderr, exit}
stop = ->
process?.kill()
process = null
{start, stop}