Question

does anyone familiar with this error on nodeclipse IDE ?

  app.delete('/delete', function(req, res) {
  ....
  });

Syntax error on token ".", , expected

Was it helpful?

Solution

delete is a reserved word in JavaScript. In express, you should use app.del(...). For you example, the following code should work:

app.del('/delete', function(req, res) {
   ...
});

OTHER TIPS

try

 app['delete'](...)

delete is a reserved word in old ES versions,so unless nodeclipse supported ES5 it may raise an error.

If nodeclipse works with jslint ,write at the top of your file

/*jslint es5:true*/

and it should remove the error.

delete was reserved word before EcmaScript 5.

Nodeclipse by default uses Eclipse JSDT-based Editor, that is not EcmaScript 5 aware (but JSHint integration is)

This is issue #70.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top