Skip to content
Advertisement

Parsing error: Unexpected token .. when using eslint

I’m fairly new to the linux webapp development scheme but there was a readme attached with the project that the previous team left me.

It said I have to call

  1. sudo npm install
  2. bower install
  3. grunt build/grunt server.

firstly, my bower.json is empty with the exception of

{
  "name": "webapp",
  "dependencies": {
    "roslib": "~0.15.0"
  }
}

and secondly when I call grunt build I get the error

error Parsing error: Unexpected token let

I also get the same error with the tokens ‘<‘ and ‘ILLEGAL’

Edit: I found that grunt build is defined as

grunt.registerTask('build', ['eslint', 'browserify', 'concat_css', copy']);

Advertisement

Answer

You should talk to the previous team and ask them about the project and get some rampup. You should probably also do at least a few tutorials on node/grunt/whatever else they’re using.

As for your issues, firstly there’s nothing wrong with the bower.json only having one dependency, that’s not an issue. Bower seems to be declining though so you could also get roslib through npm, though you’d have to understand enough about the project to replace where it’s being used to be from node_modules.

You’re probably getting the error on grunt because they’ve used let in their Gruntfile.js and you’re on an old version of node that doesn’t support let yet. The latest long term support of node.js is 6.10.3. I would update if you can.

Advertisement