nest: Running an error after the latest version is released

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

node_modules/@nestjs/common/file-stream/streamable-file.js:31 this.options.length ??= bufferOrReadStream.length; ^^^ SyntaxError: Unexpected token ‘??=’

Minimum reproduction code

https://github.com/nestjs/typescript-starter

Steps to reproduce

No response

Expected behavior

normal operation

Package

Other package

No response

NestJS version

10.2.5

Packages versions

"dependencies": {
    "@nestjs-modules/ioredis": "^1.0.1",
    "@nestjs-modules/mailer": "^1.9.1",
    "@nestjs/common": "^10.2.5",
    "@nestjs/config": "^3.1.1",
    "@nestjs/core": "^10.2.5",
    "@nestjs/jwt": "^10.1.1",
    "@nestjs/mapped-types": "*",
    "@nestjs/passport": "^10.0.2",
    "@nestjs/platform-express": "^10.2.5",
    "@nestjs/swagger": "^7.1.11",
    "@nestjs/throttler": "^5.0.0",
    "@nestjs/typeorm": "^10.0.0",
    "axios": "^1.5.0",
    "bcryptjs": "^2.4.3",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.14.0",
    "crypto-js": "^4.1.1",
    "dayjs": "^1.11.10",
    "helmet": "^7.0.0",
    "iconv-lite": "^0.6.3",
    "ioredis": "^5.3.2",
    "jssha": "^3.3.1",
    "md5": "^2.3.0",
    "mysql2": "^3.6.1",
    "nanoid": "^5.0.1",
    "node-xlsx": "^0.23.0",
    "nodemailer": "^6.9.5",
    "passport": "^0.6.0",
    "passport-jwt": "^4.0.1",
    "passport-local": "^1.0.0",
    "qiniu": "^7.9.0",
    "qs": "^6.11.2",
    "reflect-metadata": "^0.1.13",
    "request-ip": "^3.3.0",
    "rxjs": "^7.8.1",
    "svg-captcha": "^1.4.0",
    "systeminformation": "^5.21.8",
    "typeorm": "^0.3.17",
    "ua-parser-js": "^1.0.36",
    "uuid": "^9.0.1"
  },
  "devDependencies": {
    "@nestjs/cli": "^10.1.18",
    "@nestjs/schematics": "^10.0.2",
    "@nestjs/testing": "^10.2.5",
    "@types/crypto-js": "^4.1.2",
    "@types/express": "^4.17.17",
    "@types/jest": "29.5.5",
    "@types/multer": "^1.4.7",
    "@types/node": "20.6.3",
    "@types/passport-jwt": "^3.0.9",
    "@types/passport-local": "^1.0.35",
    "@types/request-ip": "^0.0.38",
    "@types/supertest": "^2.0.12",
    "@types/ua-parser-js": "^0.7.37",
    "@types/uuid": "^9.0.4",
    "@typescript-eslint/eslint-plugin": "^6.7.2",
    "@typescript-eslint/parser": "^6.7.2",
    "cross-env": "^7.0.3",
    "eslint": "^8.49.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-prettier": "^5.0.0",
    "jest": "29.7.0",
    "prettier": "^3.0.3",
    "source-map-support": "^0.5.21",
    "supertest": "^6.3.3",
    "ts-jest": "29.1.1",
    "ts-loader": "^9.4.4",
    "ts-node": "^10.9.1",
    "tsconfig-paths": "4.2.0",
    "typescript": "^5.2.2"
  }

Node.js version

18.18.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 1
  • Comments: 22 (7 by maintainers)

Most upvoted comments

解决了吗,我用阿里云的服务器也遇到这个问题了

This is purely an issue with your production environment not using the versions expected. We cannot debug this without knowing all the details. Now then likely pm2 is using some other node version then expected. Why? No clue, we don’t have access to that. But this is not an issue with the framework

However, upgrading the version of Nodejs in the production environment from v16 to v18 has no effect

@xxwangkaimin please run this in your terminal:

node -v
node -p "let a; a ??= 123"

you should see 123

Everything went fine here in v18.15.0 on Linux

I can output 123 according to your method

@xxwangkaimin Make sure you are using nodejs v16 or greater. That’s required in Nestjs v10