S0A*_*1E2 2 javascript syntax-error node.js nestjs
当我运行此nestjs代码时,遇到错误:
SyntaxError: Invalid or unexpected token
Run Code Online (Sandbox Code Playgroud)
是什么原因?
import {Controller, Get, Bind, Req, Post} from '@nestjs/common';
@Controller('cats')
export class catsController {
@Post()
create() {
return "this is a action 1ss"
}
@Get()
@Bind(Req())
findAll(request) {
return "this is a action";
}
}
Run Code Online (Sandbox Code Playgroud)
小智 12
如果遇到以下问题:
SyntaxError: Unexpected token '??='
Run Code Online (Sandbox Code Playgroud)
更新node到版本 >=16,因为该版本以下不支持上述语法
| 归档时间: |
|
| 查看次数: |
5442 次 |
| 最近记录: |