does anyone familiar with this error on nodeclipse IDE ?

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

Syntax error on token ".", , expected

有帮助吗?

解决方案

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) {
   ...
});

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top