문제

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